I don't know how many of you remember back to the old off-line reader dial up BBS days, but there was an option on many of those beasts to randomly add a "tag line" from a text file to your signature.
In showthread.php, find both occurances of:
$postbits .= getpostbit($post);
// begin TagLine Hack
$tagsignature = $post[signature];
$tagline = "\\[tagline]";
$tagpostid = $post[postid];
if (eregi($tagline,$tagsignature)) {
//don't want the signature cache anymore (only the first postid would be processed!)
unset($sigcache);
// create an array holding the signature components
$tags = split($tagline,$tagsignature);
// output the first segment, which will be the signature line plus the constant signature
$tagsignature = $tags[0];
// add the tag according to the mod of the postid
$tagcount = count($tags)-1;
if ($tagcount > 0) {
$tagid = ($tagpostid % $tagcount) + 1;
$tagsignature .= $tags[$tagid];
}
}
$post[signature] = $tagsignature;
// end TagLine Hack
In printthread.php, find:
if (!isset($sigcache["$post[userid]"])) {
$post[signature]=bbcodeparse($post[signature],0,$allowsmilies);
eval("\\$post[signature] = \\"".gettemplate("postbit_signature")."\\";");
$sigcache["$post[userid]"] = $post[signature];
} else {
$post[signature] = $sigcache["$post[userid]"];
}
// begin TagLine Hack
$tagsignature = $post[signature];
$tagline = "\\[tagline]";
$tagpostid = $post[postid];
if (eregi($tagline,$tagsignature)) {
//don't want the signature cache anymore (only the first postid would be processed!)
unset($sigcache);
// create an array holding the signature components
$tags = split($tagline,$tagsignature);
// output the first segment, which will be the signature line plus the constant signature
$tagsignature = $tags[0];
// add the tag according to the mod of the postid
$tagcount = count($tags)-1;
if ($tagcount > 0) {
$tagid = ($tagpostid % $tagcount) + 1;
$tagsignature .= $tags[$tagid];
}
}
$post[signature] = bbcodeparse($tagsignature,0,$allowsmilies);
eval("\\$post[signature] = \\"".gettemplate("postbit_signature")."\\";");
// end TagLine Hack
In newreply.php and newthread.php, find
if ($signature) {
$post['signature'] = bbcodeparse($bbuserinfo['signature'],0,$allowsmilie);
eval("\$post[signature] = \"".gettemplate("postbit_signature")."\";");
$previewmessage.=$post['signature'];
}
if ($signature) {
$post['signature'] = bbcodeparse($bbuserinfo['signature'],0,$allowsmilie);
// begin TagLine Hack
$tagsignature = $post['signature'];
$tagline = "\\[tagline]";
if (eregi($tagline,$tagsignature)) {
// create an array holding the signature components
$tags = split($tagline,$tagsignature);
// output the first segment, which will be the signature line plus the constant signature
$tagsignature = $tags[0];
// don't show any taglines in Preview mode
}
$post['signature'] = $tagsignature;
// end TagLine Hack
eval("\$post[signature] = \"".gettemplate("postbit_signature")."\";");
$previewmessage.=$post['signature'];
}
if ($message[showsignature] and $allowsignatures and trim($post[signature])!="") {
$post[signature]=bbcodeparse($post[signature],0,$allowsmilies);
eval("\$post[signature] = \"".gettemplate("postbit_signature")."\";");
} else {
$post[signature] = "";
}
if ($message[showsignature] and $allowsignatures and trim($post[signature])!="") {
$post[signature]=bbcodeparse($post[signature],0,$allowsmilies);
// begin TagLine Hack
$tagsignature = $post['signature'];
$tagline = "\\[tagline]";
if (eregi($tagline,$tagsignature)) {
// create an array holding the signature components
$tags = split($tagline,$tagsignature);
// output the first segment, which will be the signature line plus the constant signature
$tagsignature = $tags[0];
// add the tag according to the mod of the postid
$tagcount = count($tags)-1;
if ($tagcount > 0) {
$tagid = ($privatemessageid % $tagcount) + 1;
$tagsignature .= $tags[$tagid];
}
}
$post['signature'] = $tagsignature;
// end TagLine Hack
eval("\$post[signature] = \"".gettemplate("postbit_signature")."\";");
} else {
$post[signature] = "";
}
So, how does it work? After installing the three modifications above, you change your signature from
[tagline]
My first tag.
[tagline]
My second tag.
[tagline]
My third tag.
It can be multiple lines, too.
[tagline]
&c
You can quickly test it out by just applying the showthread.php modification. This is also a good way to see in the "Preview" mode what your signature variable is outputing before it gets "arrayed" by the PHP code.

And, you can use vB Code in your tag lines so that you can even have rotating links to important messages as per eva2000's tip in another forum.
Comment