View Full Version : Adding new button in Postbit
CtrlAltDel
02-02-2003, 06:27 AM
I would like to add a new button next to the, Edit/Quote, buttons in each post.
Problem?
I can't find the right place to put the code/template info.
I created a new postbit template (which contains the link and image html), and then to eval it I did a
if (ismoderator($thread['forumid'])){
eval("\$quoteDBlink = \"".gettemplate("postbit_addquote")."\";");
} else {
$quoteDBlink = " ";
}
$quoteDBlink is then in main postbit template next to where the Edit/Quote buttons are.
basically I only want mods of the forum or admins to be able to see the button.
Thing is the button never shows up. I've tried to add that code to showthread.php in a few places to no avail thus far.
Where can I add this code so that the button shows up in the right place and for the right people.
TIA
Dean C
02-02-2003, 10:21 AM
In showthread.php find:
if ($postdone[$post[postid]]) {
Add above it:
if (ismoderator($thread['forumid'])
{
eval("\$quoteDBlink = \"".gettemplate('postbit_addquote')."\";");
} else {
$quoteDBlink = " ";
}
Now then insert $quoteDBlink in your postbit template making sure you have actually made the postbit_addquote template and put content in it :)
Regards
- miSt
- miSt
CtrlAltDel
02-02-2003, 04:59 PM
mist, first off thanks a lot for taking the time to give me a nice reply.
thing is, here is what my showthread looks like before you posted that.
while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
if (ismoderator($thread['forumid'])){
eval("\$quoteDBlink = \"".gettemplate('postbit_addquote')."\";");
} else {
$quoteDBlink = " ";
}
if ($postdone[$post[postid]]) {
here is the postbit template
<td align="right" nowrap><smallfont>
$quoteDBlink
<a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="https://vborg.vbsupport.ru/images/edit.gif" border="0" alt="Edit/Delete Message"></a>
<a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="https://vborg.vbsupport.ru/images/quote.gif" border="0" alt="Reply w/Quote"></a>
</smallfont></td>
here is my postbit_addquote
<a href="/addquote.php?&a=fa&postid=$post[postid]"><img src="{imagesfolder}/quotedb.gif" border="0" alt="Add Quote to QuotesDB"></a>
issue is, it wont show up at all. even if i comment all of the code in showthread except the eval statement it still wont work. im kinda puzzled why this wouldnt be working.
CtrlAltDel
02-02-2003, 05:22 PM
i even just tried this as my if statement instead and it didn't work.
if ($bbuserinfo['usergroupid']==6 || $bbuserinfo['usergroupid']==7){
Dean C
02-02-2003, 05:38 PM
Ok well i think i can locate the problem.
Try this code instead:
if (ismoderator($thread['forumid'])
{
$postbitquote ="eval("\$quoteDBlink = \"".gettemplate('postbit_addquote')."\";")";
} else {
$postbitquote = " ";
}
Not sure whether that will work because i've never tried assigning a tempalte call to a variable
- miSt
CtrlAltDel
02-02-2003, 05:41 PM
in showthread i did a
print $quoteDBlink;
and it put the button on the top of the page as expected, granted the {imagesfolder} part didnt get parsed to the correct thing yet. But I can't figure out why the variable isn't getting passed to the postbit template.
CtrlAltDel
02-02-2003, 05:47 PM
you're code's not going to work because the syntax doesnt look right, the quotes arn't gonna work out.
CtrlAltDel
02-02-2003, 05:49 PM
the variable is getting assigned, i just dont know why its not showing up in the postbit template, 'cause I can just print it out after that if statement and it shows the correct info, but it wont show up in the template.
CtrlAltDel
02-06-2003, 12:54 AM
hmm well i cant pass any variable out of that section for some reason, this is odd. man does vb's coding style tick me off sometimes.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.