Posted on: 10/15/02 06:27am
By: 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:
$story_template->set_var('site_url', $_CONF['site_url']);
Insert a /* in front of it, to start a comment block. A few rows further down, find this line:.COM_endBlock());
Insert a */ at the end to end the comment block. This change removes the two blocks entirely.
- 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):
$article->set_var( 'email_icon', '<a href="' .....
$article->set_var( 'print_icon', '<a href="' ....
Copy both of these lines (the whole lines, of course), and paste them just above the closing } tag in the "index == 'n'" section.
Save all your changes, and then load a full-text article and admire your handiwork!
Thanks again to Dirk for 99.5% of the effort on this one!
-rob.
Remove What's Related in 1.3.11?
Posted on: 04/05/05 02:08pm
By: lifesize_ben
Does anyone know how to do this in GL 1.3.11? I was able to figure out how to get rid of the what's related and story options block, but can't figure out how to turn on the email_icon and print_icon (supposedly in lib-common.php). Where do I find the code for this?
Remove What's Related/Options blocks
Posted on: 04/06/05 02:18pm
By: Dirk
The COM_article function mentioned above has been renamed STORY_renderArticle and moved to system/lib-story.php
bye, Dirk
Remove What's Related/Options blocks
Posted on: 04/06/05 11:37pm
By: lifesize_ben
Thanks much, Dirk. Found what I needed. I thought I'd post some more explicit instructions, since it's a bit different from the ones in the version listed above:
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.
Remove What's Related/Options blocks
Posted on: 12/21/05 04:54pm
By: inquest750
[QUOTE BY= lifesize_ben] Thanks much, Dirk. Found what I needed. I thought I'd post some more explicit instructions, since it's a bit different from the ones in the version listed above:
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.
[/QUOTE]
I just don't understand this, can someone help me?
Remove What's Related/Options blocks
Posted on: 12/21/05 05:11pm
By: Dirk
[QUOTE BY= inquest750] I just don't understand this, can someone help me?[/QUOTE]
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