sNews Forum

Previous sNews versions => sNews 1.4 Final => Mods and Addons => Topic started by: centered on June 06, 2007, 12:55:14 pm

Title: [MOD - mini] Byline with "permalink" (converted from sNews 1.6)
Post by: centered on June 06, 2007, 12:55:14 pm
Original post here: http://www.solucija.com/forum/viewtopic.php?id=4889

Credit goes to Agentsmith - great idea!!

Haven't tested this out but here it goes:

For those rare 1.4 users:

0. Backup

1. At the end of Lang variables put
Code: [Select]
$l['permalink'] = 'Permalink';2. Lets take the function tags from 1.6!  I put this after  WEBSITE FUNCTIONS
Code: [Select]
function tags($tag) {

$tags['byline'] = 'permalink, | ,Posted in ,category, ';

return $tags[$tag];

}
3. Find this section in // center
Code: [Select]
        if ($article == "") {
      if ($r['displayinfo'] == "YES") {
      echo "

";
      if (strlen($r['text']) > $shorten) {      
      echo " ". l('read_more') ." ";
      }
      if ($commentable == "YES" or $commentable == "FREEZ") {
      echo " ". l('comments') ."(". $comments_num .") ";
      }
      echo " " .$fp_date_format. "

";
Replace with this:
Code: [Select]
        if ($article == "") {
$byline = $r['displayinfo'] == 'YES' ? true : false;

      if ($r['displayinfo'] == "YES") {
      echo "

";

      if (strlen($r['text']) > $shorten) {      

      echo " ". l('read_more') ." ";

      }
if ($byline == true) {
                        $tag = explode(',', tags('byline'));
                        foreach ($tag as $tag ) {
                          switch ($tag) {
case ($tag == 'permalink'): echo " ";
                                case ($tag == 'permalink'): echo ''.l('permalink').''; break;
                                case ($tag == 'category'): echo ''.find_cat_sef($r['category']).' on '; break;
                                default: echo $tag;
                            }
                        }
                    }


      echo " .$fp_date_format.  ";

      if ($commentable == "YES" or $commentable == "FREEZ") {

      echo " ". l('comments') ."(". $comments_num .") ";

      }
Again, it hasn't been really tested so try it and see if it works for you
(http://img201.imageshack.us/img201/466/screenshotie0.th.png) (http://img201.imageshack.us/my.php?image=screenshotie0.png)