1 andrew Mar 09, 2005 00:39
3 andrew Mar 09, 2005 00:59
I have already read that specific thread. I need to know where the actual definition of the $Item->Content() function is because I want to modify the actual output of the script. The entire <a href=...> section is hardcoded somewhere and I can't find where to change that. I can change the stuff between the <a href=...> and </a> tags, but not what's in the actual <a href=...> tag.
4 andrew Mar 09, 2005 01:15
I found, in _functions_bposts.php the following code:
if ($dispmore)
{ // Viewer has already asked for more
if( !empty($more_anchor) ) $output .= $before_more_link;
$output .= '<a id="more'.$id.'" name="more'.$id.'"></a>'.$more_anchor;
if( !empty($more_anchor) ) $output .= $after_more_link;
$output .= $content[1];
}
else
{ // We are offering to read more
$more_link = gen_permalink( $file, $id, 'id', 'single', 1 );
$output .= $before_more_link.'<a href="'.$more_link.'#more'.$id.'">'.$more_link_text.'</a>'.$after_more_link;
}
I thought if I replaced
$output .= $before_more_link.'<a href="'.$more_link.'#more'.$id.'">'.$more_link_text.'</a>'.$after_more_link;
with something like this
$output .= $before_more_link.'<a href="'.$more_link.'#more'.$id.'".'class="whatever"'>'.$more_link_text.'</a>'.$after_more_link;
that it would output what I wanted, but it didn't do anything. I could have just made a PHP error, or I could be barking up the wrong tree. At any rate, help is still needed.
5 andrew Mar 09, 2005 02:20
I found it. It seems _class_item.php overrides the other file. At any rate, for those that want to know how to change the code, I replaced
{ // We are offering to read more
$output = $content_parts[0];
$output .= $before_more .
'<a href="'.$this->gen_permalink( 'pid', $more_file ).'#more'.$this->ID.'">'.$more_link_text.'</a>' .$after_more;
}
with this
{ // We are offering to read more
$output = $content_parts[0];
$output .= $before_more .'<a href="'.$this->gen_permalink( 'pid', $more_file ).'#more'.$this->ID.'" class="more"'.'">'.$more_link_text.'</a>' .$after_more;
}
and it worked fine.
6 edb Mar 09, 2005 02:41
Doesn't matter if you like hearing about search or not, SEARCH a little bit! Like, maybe start with the user manual. http://b2evolution.net/man/2005/02/25/how_to_get_rid_of_the_gread_more covers altering the content function via your skin instead of hacking, which has has a noticably lower probability of surviving upgrades than your skin does.
Search is your friend. The User Manual is your best friend.
7 andrew Mar 09, 2005 02:46
Well, at the time I did not believe that to help me. I later found out that the error was actually in my CSS. The manual wasn't going to help me with what I thought I needed to do, because I read about the function and couldn't figure out how to add a class to the link itself without hacking the code. Too bad I forgot it was already contained within a class that I could use.
8 marcdk May 06, 2005 01:23
Is there a way to put the permalink behind the "read more" link because of the nicer url?
9 cooleddie Mar 29, 2006 03:58
Is there a way to get rid of the paragraph that the Read More automatically creates? I tried deleting the code the following in _class_item.php but with no success.
if( $before_more == '#' )
$before_more = '<p class="bMore">';
if( $after_more == '#' )
$after_more = '</p>';
http://forums.b2evolution.net/viewtopic.php?t=3212
has most of the meaty info on MORE