Version: , by Sean
Developer Last Online: Nov 2002
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.
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) {
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==1 and $pagenumber==1 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==1 and $pagenumber==1 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))
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..
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.
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.
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) {
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.