PDA

View Full Version : Passing threadid properly in template hack


jacy
02-02-2002, 05:10 PM
I posted this on vbulletin.com in the Templates forum but I'm wondering if it's veering to closely toward a hack, so I'm trying here, too. Sorry for any double effort.

I've modified my thread options links (print, email and subscribe, with their images) to be part of my forumrules template. Looks the way I want, but I can't get the threadid to pass into the link properly.

I've tried adding an eval to function.php, including the forumrules template in templatesused in showthread.php, and so on. Nothing seems to get it to work. I'm sure I'm missing something rather obvious and simple but can't get at it.

Here's an example of how I would like it formatted. The thread options are in a third TD tag in the forumrules table at the bottom:
http://asthmatrack.org/forums/showthread.php?threadid=1358

Click one of the thread options and you'll get the 'no thread id' error message. My forumrules template is as follows:

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E"><tr><td>
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td bgcolor="#13486D"><smallfont>
You <b>may $rules[postnew]</b> post new threads.<br>
You <b>may $rules[postreply]</b> post replies.<br>
You <b>may $rules[attachment]</b> post attachments.<br>
You <b>may $rules[edit]</b> edit your posts.
</smallfont></td>
<td bgcolor="#13486D"><smallfont>
<a href="misc.php?s=$session[sessionhash]&action=bbcode" target="_blank">vB code</a> is <b>$bbcodeon</b><br>
<a href="misc.php?s=$session[sessionhash]&action=showsmilies" target="_blank">Smilies</a> are <b>$smilieson</b><br>
<a href="misc.php?s=$session[sessionhash]&action=bbcode#imgcode" target="_blank">[IMG]</a> code is <b>$imgcodeon</b>
</smallfont></td><td bgcolor="#13486D"><smallfont><img src="https://vborg.vbsupport.ru/images/printer.gif" alt="" border="0" align="absmiddle">
<a href="printthread.php?s=$session[sessionhash]&threadid=$threadid">Show Printable Version</a><br><img src="https://vborg.vbsupport.ru/images/sendtofriend.gif" alt="" border="0" align="absmiddle">
<a href="sendtofriend.php?s=$session[sessionhash]&threadid=$threadid">Email this Page</a><br><img src="https://vborg.vbsupport.ru/images/subscribe.gif" alt="" border="0" align="absmiddle">
<a href="member2.php?s=$session[sessionhash]&action=addsubscription&threadid=$threadid">Subscribe to this Thread</a>
</smallfont>
</td></tr>
</table>
</td></tr></table>


Thanks for any help! I bought vBulletin almost 2 years ago but gave up getting it running out of frustration and ignorance. Finally went at it again last night after learning of the vServers issues (my server) and got it up and running and my old board imported in a matter of a couple hours. Now if I can just get these little AR aesthetic details worked out... ;)

~Jacy

Admin
02-03-2002, 12:53 PM
You need to globalize $threadid in the getforumrules() function:
function getforumrules($foruminfo,$permissions) {
// array of foruminfo and permissions for this forum
global $offtext,$ontext,$forumrules,$session,$threadid;
(what you need to add is highlighted)

jacy
02-03-2002, 06:57 PM
That did the trick, Chen. Knew it had to be something very simple but crucial. Thanks so much for the reply!

~Jacy

Admin
02-04-2002, 01:04 PM
No probs. :)