new hack for b2
April 14th, 2003
BTW, the newest version of this hack could be found here new hack for b2
yay.. i stole this javascript display and hide function from movable type. it’s actually kinda easy to hack. if you want to use it or see how it works, click on “read more”.
first, you want to download this javascript file (right click and save target as). then open your b2template.functions.php in your b2-include directory and
$output .= ” <a href=”$file?p=$id&more=1″>$more_link_text</a>”;
and replace it with:
$output .= ” <span id=”varP$id”><br /><a href=”$file#$id” onclick=”showMore($id,’$file#$id’);return false;”>read more »</a></span><div id=”varXYZ$id” style=”display: none”>$content[1]<br /><a href=”#$id” onclick=”showMore($id,0);return true;”>« hide more</a></div>”;
save and reupload.
MAKE SURE you have <script language=”JavaScript” SRC=”http://yourdomain/dir/oops.js”></script> in your <head> and </head> or else it won’t work.
then of course just like before, you write the “read more” entry with <!–more–> in b2.
that’s how it worked for me. i hope it works for you, too. if not, hmm oh well.
23 Comments Leave a Comment
April 14th, 2003 at 10:47 pm April 14th, 2003 at 10:48 pm April 14th, 2003 at 10:48 pm April 14th, 2003 at 10:49 pmhey what is movable type? and i like ur site. mucho! um i was wondering if u could lend me the codes for when u click the link and everything shows up on the bottom! like ur opening a folder on the computer. i thought it was really cool. and i was also wondering if u could lend me the codes for at the top of ur site when u hover over the picture links those little text boxes show up. those were the coolest things! if u could please email them to me. and when i make my site i will give u the credit and link to ur site! thanx
*waits for the sky to fall*
Dodo, I think it was only that one time, maybe while you were programming or whatnot. Tracy, MovableType is another blogging tool like b2 and Blogger. It does the same thing, but does it differently. 
oooh very nice!!
It didn’t work in mozilla though:( But I just might use it anyways :P
Whoa, cool script dodo. o_O!!!! Wow, I would really love to use this.. =D I’d have to install b2! T.T But if I go back, this script would be cool. =D =D
oOoOoO me using it!! it’s sweeet
like it dodo!! hehehe thanks for the hack! no javascript error! w0ot! =DD
The hack looks great. I have a question, though. Did you do any prior modifications to the b2template.functions.php file? I’m asking because I couldn’t find that line in my file at all for some reason. Perhaps it’s the version (mine is 0.6pre5)? I’d appreciate any replies to my inquiries. Thanks in advance.
hmm really? i don’t know. i’m using an older version. don’t even remember its actual number. i haven’t updated for so long. yes i hack a lot but i thought not that part hmm i don’t know. ecila found it?! what version are you using ecila?
your code might not appear to be exactly the same. first find
$content=explode(”<!–more–>”,$content);
and then after that, find something like if ($more) { blah } else { blah }
just replace the else part in the parentheses.
i THINK i’m using the latest one….
but yeaa, the line you told us to find, i couldn’t find, but i found what was closest… and it was the following
<br />
$output .= ' <a href="'.$file.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'more'.$querystring_equal.'1#more'.$id.'">'.$more_link_text.'</a>';<br />
opps…
$output .= ‘ <a href=”‘ . $file.$querystring_start . ‘p’ . $querystring_equal . $id . $querystring_separator . ‘more’ . $querystring_equal . ‘1#more’ . $id . ‘”>’ . $more_link_text .’</a>’;
wahh! hahaah i screwed it up XDD lol!
but yeaa.. just look for a line which begins with $output .=
and includes
‘.$more_link_text.’
=)
Ergh.. I have a slight problem. The hack seems to be working, but I don’t know how to end it ! I know it starts with Do you end it with ? (I might want to have text after the read more thing… :|
yemthe wachtwoord


I think it does, luvvie!