Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-02-2003, 06:27 AM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Adding new button in Postbit

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

Code:
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
Reply With Quote
  #2  
Old 02-02-2003, 10:21 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In showthread.php find:

PHP Code:
if ($postdone[$post[postid]]) { 
Add above it:

PHP Code:
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
Reply With Quote
  #3  
Old 02-02-2003, 04:59 PM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

PHP Code:
while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

if (
ismoderator($thread['forumid'])){
  eval(
"\$quoteDBlink = \"".gettemplate('postbit_addquote')."\";");
} else {
  
$quoteDBlink "&nbsp;";
}

  if (
$postdone[$post[postid]]) { 

here is the postbit template
Code:
<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
Code:
<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.
Reply With Quote
  #4  
Old 02-02-2003, 05:22 PM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i even just tried this as my if statement instead and it didn't work.

PHP Code:
if ($bbuserinfo['usergroupid']==|| $bbuserinfo['usergroupid']==7){ 
Reply With Quote
  #5  
Old 02-02-2003, 05:38 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok well i think i can locate the problem.

Try this code instead:

PHP Code:
if (ismoderator($thread['forumid'])
{
$postbitquote ="eval("\$quoteDBlink = \"".gettemplate('postbit_addquote')."\";")";
} else {
 
$postbitquote = "&nbsp;";

Not sure whether that will work because i've never tried assigning a tempalte call to a variable

- miSt
Reply With Quote
  #6  
Old 02-02-2003, 05:41 PM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 02-02-2003, 05:47 PM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you're code's not going to work because the syntax doesnt look right, the quotes arn't gonna work out.
Reply With Quote
  #8  
Old 02-02-2003, 05:49 PM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 02-06-2003, 12:54 AM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:11 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04391 seconds
  • Memory Usage 2,254KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete