vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding new button in Postbit (https://vborg.vbsupport.ru/showthread.php?t=48431)

CtrlAltDel 02-02-2003 06:27 AM

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

Dean C 02-02-2003 10:21 AM

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

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.

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.

CtrlAltDel 02-02-2003 05:22 PM

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

PHP Code:

if ($bbuserinfo['usergroupid']==|| $bbuserinfo['usergroupid']==7){ 


Dean C 02-02-2003 05:38 PM

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

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.


All times are GMT. The time now is 01:10 PM.

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.01048 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete