The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Need to call up custom field in "lastpostby" template from thread table
Hello ,
i Need to call up custom field in "lastpostby" template from thread table my Version 3.8.7 i try this code hook : forumbit_display in templat forumhome_lastpostby : $lastpostinfo[threadphoto] PHP Code:
PHP Code:
|
#2
|
|||
|
|||
Not long ago someone asked this same question (they even worded it the same way - weird). Anyway, it's here: www.vbulletin.org/forum/showthread.php?t=293100
|
#3
|
||||
|
||||
not weird , i see this thread already and i copy same title
i try same code , not worked ... so , i write new thread ... thanks kh99 , i waiting ur Suggestions regarding about my problem or what's wrong in my code Note : my Version 3.8.7 not 4.×.× |
#4
|
|||
|
|||
Quote:
Code:
$tachyjoin .= " LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = forum.lastthreadid) "; $counter_select .= ", thread.threadphoto"; |
#5
|
||||
|
||||
ok , i try this code and the hook : cache_ordered_forums
Shows me this error PHP Code:
Note : some forum on lastthreadid filed = 0 |
#6
|
|||
|
|||
Hmm...OK, try this:
Code:
if (!($vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))) { $counter_select = str_replace(', ', ', forum.', $counter_select); } $tachyjoin .= " LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = forum.lastthreadid) "; $counter_select .= ", thread.threadphoto"; |
#7
|
||||
|
||||
Quote:
it worked good now . Thank you with all my heart Now, The final question, if u allowed I want to put a condition if {} in the case of content not available in the field threadphoto |
#8
|
|||
|
|||
Quote:
Code:
<if condition="empty($lastpostinfo[threadphoto])"> No threadphoto <else /> Threadphoto is $lastpostinfo[threadphoto] </if> As long as threadphoto can't be 0 (because that would make empty() true). |
Благодарность от: | ||
omardealo |
#9
|
||||
|
||||
ok that's good i use this template
PHP Code:
look , i add this template in forumhome_lastpostby template by this hook : forumbit_display This code replaces all the template : PHP Code:
PHP Code:
i want put my template At the beginning of the template forumhome_lastpostby ------------------------------------------------------------------------------------------------------------------------- For any one want to call this field in forumdisplay Beside title threads 1 - plugin 1 hook : forumdisplay_query code : PHP Code:
hook : global_start code : PHP Code:
PHP Code:
|
#10
|
||||
|
||||
kh99 , Waiting u ...
thnx . |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|