Welcome to Geeklog Monday, September 21 2020 @ 05:59 am EDT

Geeklog Forums

Seperate Display Logic For article.php


Status: offline

arthur1

Forum User
Newbie
Registered: 07/11/03
Posts: 3
Ok-

So what i wanted was different formating between what gets displayed on topic pages and on index pages vs. what gets displayed on article pages. So I did a bit of poking around and developed this hack for the article.php page and the article.thtml

the following code gives me these additional template variables in article.thml:

{article_story_title}
{article_email_icon} {article_print_icon}
{article_story_introtext}
{article_story_bodytext}

this allows you to not use: {formatted_article} which carries the formating from storytext.thtml Somebody who has used GL more than i have want to check me on this? This seems like a pretty obvious hack that might be usefull.... I'd be happy to add it to the documentation or whatever the protocol is around here...


here's the code i added to article.php I stuck in in toward the end of the file- above the display call.

PHP Formatted Code
$story_template->set_var('article_story_bodytext', stripslashes ($A['bodytext']));
            $story_template->set_var( 'article_story_title', stripslashes( $A['title'] ));
                $story_template->set_var( 'article_story_introtext', stripslashes( $A['introtext'] ));
               
                 if( $_CONF['hideemailicon'] == 1 )
                                {
                                        $story_template->set_var( 'article_email_icon', '' );
                                }
                                else
                                {
                                        $story_template->set_var( 'article_email_icon', '<a />
                                                . '
/profiles.php?sid=' . $A['sid'] . '&what=emailstory">'
                                                . '
                                                . '/images/mail.gif"
alt="' . $LANG01[64]
                                                . '"
title="' . $LANG11[2] . '" border="0"></a>' );
                                }
                                if( $_CONF['hideprintericon'] == 1 )
                                {
                                        $story_template->set_var( '
article_print_icon', '' );
                                }
                                else
                                {
                                        $story_template->set_var( '
article_print_icon', '<a />
                                                . '/article.php?story=' . $A['sid']
                                                . '&mode=print">
                                                . $_CONF['layout_url'] . '
/images/print.gif" alt="'
                                                . $LANG01[65] . '
" title="' . $LANG11[3] . '"></a>' );
                                }
 Quote

All times are EDT. The time is now 05:59 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content