Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Please read if you know ANYTHING about hacking vB! Details »»
Please read if you know ANYTHING about hacking vB!
Version: , by Sean Sean is offline
Developer Last Online: Nov 2002 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 07-05-2002 Last Update: Never Installs: 0
 
No support by the author.

Ok, i got custom testboxes to load entries into the thread table. its there! But, now what file do I need to edit to load that variable into my postbit template (showthread.php)? I tried $post[variable] but that didn't work? Am I using the wrong variable? or is there a file I need to edit? If I need to edti a file, which one?

Thanks!!
-Sean

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-02-2002, 05:59 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes you globalized them correctly. Now to display it in postbit, edit your postbit template and put your custom variables ($maker,$maker_mail,$model_dl) there.

This will display these variables in all posts. If you want to display in only first post try this: in showthread.php, find:

PHP Code:
$postbits '';
$counter=0;
$postdone = array();
$sigcache = array();
while (
$post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);

Replace it as:

PHP Code:
$postbits '';
$counter=0;
$counter2=0;
$postdone = array();
$sigcache = array();
while (
$post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
$counter2++;
if (
$counter2!=1)
{
$maker='';
$maker_mail='';
$model_dl='';
}
  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);

Reply With Quote
  #23  
Old 08-03-2002, 02:34 AM
Sean's Avatar
Sean Sean is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like version 2.2.6 is different from 2.2.2 (what I'm using). I'm guess that's for 2.2.6? Here's what i have, I think it's pretty much the same?

PHP Code:
LINE 406 TO.....

$counter=0;
while (
$post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post[b][u],iif($counter==and $pagenumber==and $thread['forumid']==41 or $thread['forumid']==42 or $thread['forumid']==44 or $thread['forumid']==45'postbit_first''postbit')[/u][/b][u][/u]);
}

...
418 
(I added some code (in bold & Underlined) for my "first post different" hack.)

Here's what I tried:

PHP Code:
$counter=0;
$counter2=0;
$postdone = array();
$sigcache = array();
while (
$post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
$counter2++;
if (
$counter2!=1)
{
$maker='';
$maker_mail='';
$model_dl='';
}
  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post[b][u],iif($counter==and $pagenumber==and $thread['forumid']==41 or $thread['forumid']==42 or $thread['forumid']==44 or $thread['forumid']==45'postbit_first''postbit')[/u][/b]);

I tried $post[maker] and $maker, and neither worked. Could it be due to the different version (if that was 2.2.6))

Thanks for all the help!
Reply With Quote
  #24  
Old 08-04-2002, 03:44 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1- Did you use $maker in postbit?
2- Does "echo $maker;" in showthread.php displays your info in debug? You said you can get your variable successfully in showthread.php, so I'm assuming that $maker variable is correctly assigned its value in showthread.php.. You'd better make sure..
Reply With Quote
  #25  
Old 08-04-2002, 10:28 PM
Sean's Avatar
Sean Sean is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using echo thread['maker']; works in showthread.php.

Where am i suppose to use eacho $maker;?

Don't worry about modifying anything so it only appears in teh first post. All I need to know is how to get the variable into postbit, my template hack will do the rest.
Reply With Quote
  #26  
Old 08-05-2002, 06:06 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Using echo thread['maker']; works in showthread.php.
ok then use:

$maker=$thread['maker'];

in showthread.php (after $thread['maker'] is populated and BEFORE function getpostbit is called) and all must be set provided that $maker is put into your postbit template and it's globalized as you confirmed in your previous message.
Reply With Quote
  #27  
Old 08-05-2002, 12:11 PM
Sean's Avatar
Sean Sean is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you sooo much!

I think its also possible to get the variables into forumdisplay.php, because these forums do the same thing in the hacks forum.

Do you know how I could do that? This isn't as important, it would just be awesome if I could do it.
Reply With Quote
  #28  
Old 08-05-2002, 02:00 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess you should modify this section in forumdisplay.php:

PHP Code:
$threads=$DB_site->query("
SELECT 
$dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
    thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postuserid,
    lastposter,thread.dateline,views,thread.iconid,notes,thread.visible,sticky,votetotal,attach
    FROM thread
    "
.iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
    
$dotjoin
    WHERE 
$threadids
    ORDER BY sticky DESC, 
$sortfield $sqlsortorder
    "
); 
As:
PHP Code:
$threads=$DB_site->query("
SELECT 
$dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
    thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postuserid,
    lastposter,thread.dateline,views,thread.iconid,notes,thread.visible,sticky,votetotal,attach,thread.YOURCUSTOMFIELD
    FROM thread
    "
.iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
    
$dotjoin
    WHERE 
$threadids
    ORDER BY sticky DESC, 
$sortfield $sqlsortorder
    "
); 
Then a few lines below right after:
PHP Code:
while ($thread=$DB_site->fetch_array($threads)) { // and $counter++<$perpage) { 
add

PHP Code:
$maker=$thread['YOURCUSTOMFIELD']; 
and use $maker in the relevant template..

Not tested, should work...
Reply With Quote
  #29  
Old 08-05-2002, 02:30 PM
Sean's Avatar
Sean Sean is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!! man, you rock!

Works perfect!

Since you are on such a roll, could you tell me if its possible to get the # of posts - # of threads? (EG: 15 posts, but 10 threads, therefore 5 comments & this would be displaying forums inside a category) I am wondering if its possible so i can show how many comments there are, and how many reviews there are. I tried doing a simple equation in forumdisplay.php, but it didn't seem to do anything. Do you know if its possible? If it is possible, could you tell me where to put the equation? Again, this is not a must, just another thing that would be awesome to do.

Thanks again!
Reply With Quote
  #30  
Old 08-05-2002, 04:46 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont think I understand what you want to do?
Reply With Quote
Reply

Thread Tools

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 01:49 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.04403 seconds
  • Memory Usage 2,334KB
  • Queries Executed 24 (?)
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
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete