Welcome to Geeklog, Anonymous Wednesday, December 11 2024 @ 05:12 am EST
Geeklog Forums
Remove What's Related/Options blocks...
griffman
I'm building a two-column replacement for my current site's three-column display. All was looking good, except for articles that had "Read More" links. When I viewed the full text of the article, I would get three columns - the left side blocks, the article/comments block, and two blocks on the right side. One of these is the "What's Related" block, the other is the "Story Options" block. I wanted them gone. With some help (OK, tons of help!) from Dirk, we've now accomplished the objective.
The following changes will remove these two blocks and the additional column they reside in from your pages. They will bring back the "story options" functionality by displaying the same icons that are used on the "intro text only" views, but you will lose the "What's Related" block. To me, that's not a big deal. Here's how to do it...
- In article.php, find this line:Insert a /* in front of it, to start a comment block. A few rows further down, find this line:Text Formatted Code$story_template->set_var('site_url', $_CONF['site_url']);Insert a */ at the end to end the comment block. This change removes the two blocks entirely.Text Formatted Code.COM_endBlock());
- In article.thtml (inside the article folder in your theme folder), add a "<!--" comment marker in front of the first <td> tag, and a "-->" end comment marker at the very end of the file. This removes the spacer column and the column reserved for the blocks we're removing.
- There's still a dangling </td> to be found, as it's not located in article.thtml. Instead, you'll find it in footer.thtml, as the second line of the file (just below the comment). Add comment tags (<!--, --> around the </td> tag to disable it.
- The last step is to get the email and print icons back in the story, where they originally appeared. I thought this would be the hardest step, but it's actually trivial. Open lib-common.php, and move to the COM_article() function (line 307 in my modified lib-common). Within COM_article(), find the "if ( $index == 'n' ) section, which will consist of only two lines. We need to add two more lines before the closign } tag, and we're going to steal them from the "index == 'y'" section. The two lines start as follows (trimmed here for display purposes):Copy both of these lines (the whole lines, of course), and paste them just above the closing } tag in the "index == 'n'" section.Text Formatted Code$article->set_var( 'email_icon', '<a href="' .....
$article->set_var( 'print_icon', '<a href="' ....
Thanks again to Dirk for 99.5% of the effort on this one!
-rob.
lifesize_ben
lifesize_ben
in system/lib-story.php, find the STORY_renderArticle function, and go to the section that starts
if( $index == 'n' )
{
$article->set_var( 'story_title', stripslashes( $A['title'] ));
if( empty( $A['bodytext'] ))
{
In GL 1.3.11, there isn't an if( $index == 'y' ), it's just an [else] statement, so to enable the print, email (and pdf, if enabled) icons, you need to scroll down and find the series of if/else statements that starts with
if( $_CONF['hideemailicon'] == 1 )
{
$article->set_var( 'email_icon', '' );
}
You'll need to copy the entire set of three if/else statements (one for print, one for email, one for pdf), all the way down to the last ending bracket. The last bit of code looks like this:
$article->set_var( 'lang_pdf_story_alt', $LANG01[111] );
}
else
{
$article->set_var( 'pdf_icon', '' );
}
After you've copied that whole bit of code, go back up to the ( $index == 'n' ) section, and find the "else" part of the if( empty( $A['bodytext'] )) section. Paste the code into the "else" section, under what's already there:
else
{
$bodytext = stripslashes( $A['bodytext'] );
$bodytext = PLG_replacetags($bodytext); // Replace any plugin autolink tags
$article->set_var( 'story_introtext', $introtext . '<br><br>'
. $bodytext );
$article->set_var( 'story_text_no_br', $introtext . $bodytext );
PASTE IT IN RIGHT HERE!
}
In future versions of Geeklog, I'm not sure it would be such a bad thing to have the print and email icons in article view, even with the what's related/story options block. My two cents.
inquest750
in system/lib-story.php, find the STORY_renderArticle function, and go to the section that starts
if( $index == 'n' )
{
$article->set_var( 'story_title', stripslashes( $A['title'] ));
if( empty( $A['bodytext'] ))
{
In GL 1.3.11, there isn't an if( $index == 'y' ), it's just an [else] statement, so to enable the print, email (and pdf, if enabled) icons, you need to scroll down and find the series of if/else statements that starts with
if( $_CONF['hideemailicon'] == 1 )
{
$article->set_var( 'email_icon', '' );
}
You'll need to copy the entire set of three if/else statements (one for print, one for email, one for pdf), all the way down to the last ending bracket. The last bit of code looks like this:
$article->set_var( 'lang_pdf_story_alt', $LANG01[111] );
}
else
{
$article->set_var( 'pdf_icon', '' );
}
After you've copied that whole bit of code, go back up to the ( $index == 'n' ) section, and find the "else" part of the if( empty( $A['bodytext'] )) section. Paste the code into the "else" section, under what's already there:
else
{
$bodytext = stripslashes( $A['bodytext'] );
$bodytext = PLG_replacetags($bodytext); // Replace any plugin autolink tags
$article->set_var( 'story_introtext', $introtext . '<br><br>'
. $bodytext );
$article->set_var( 'story_text_no_br', $introtext . $bodytext );
PASTE IT IN RIGHT HERE!
}
In future versions of Geeklog, I'm not sure it would be such a bad thing to have the print and email icons in article view, even with the what's related/story options block. My two cents.
I just don't understand this, can someone help me?
Dirk
I'm too lazy to digg through all that code now, but to solve the original problem (note the date of that post), you could simply edit the template file (article/article.thtml) and move the What's Related and Story Options blocks out of the way. In the Professional theme, they are below the story text, for example.
bye, Dirk
- 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