The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#152
|
||||
|
||||
Quote:
Thx. |
#153
|
|||
|
|||
Can somebody tell me how I would display the latest threads in a sidebar instead?
|
#154
|
||||
|
||||
Hi... I'm really frustrated. This will be the second hack I am attempting to install, and isn't going so well.
I followed your instrctions to a "t" and am getting a parse error. I read through this entire thread and found where you say that it can only happen if you copy and paste the code incorrectly. Yet I still get the following error: Parse error: parse error, unexpected T_STRING in /home/xhmgami/public_html/forum/index.php on line 460 I'm pretty damn sure I did it correctly. I found my file and saved to desktop. I made a copy and opened in DW. I then did a search for 'forumhome_subforumseparator_post', in DW this was RED and was towards the top of the page on line 49 <--- given to me by DW. I then highlighted that line and replaced it with everything here: Code:
// [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] 'forumhome_subforumseparator_post', 'forumhome_latestthreadbit' // [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] Code:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ### Code:
// [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 2 ] // #################### PROCESS LATEST THREADS ####################### // fetch the permissions for each forum $forumperms = array(); foreach($forumcache AS $forum) { $forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']); // ## HIDE FORUMS WITHOUT THE CANVIEW OR CANVIEWOTHERS PERMISSION ## if (!($forumperms["$forum[forumid]"] & CANVIEW) || !($forumperms["$forum[forumid]"] & CANVIEWOTHERS)) { $limitfids .= ','.$forum['forumid']; } } unset($forum); if ($vboptions['threadpreview'] > 0) { $previewfield = ', post.pagetext AS preview'; $previewjoin = 'LEFT JOIN '.TABLE_PREFIX.'post AS post ON(post.postid = thread.firstpostid)'; } $getthreads = $DB_site->query(" ## GET LATEST THREADS ## SELECT thread.*,thread.iconid AS threadiconid $previewfield FROM ".TABLE_PREFIX."thread AS thread LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread') $previewjoin WHERE open = '1' AND forumid NOT IN (0$limitfids) AND thread.visible = '1' AND deletionlog.primaryid IS NULL ORDER BY lastpost DESC LIMIT 5"); while($thread = $DB_site->fetch_array($getthreads)) { $threads = true; $thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22)); $thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1); $thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']); $thread['preview'] = preg_replace('#\[quote(=("|"|\'|).*\\2)?\](.*)\[/quote\]#siU', '', $thread['preview']); $thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($thread['preview']), false, true), $vboptions['threadpreview'])); $thread['replycount'] = vb_number_format($thread['replycount']); $thread['views'] = vb_number_format($thread['views']); // thread icon $show['icon'] = false; $icon = fetch_iconinfo($thread['iconid']); if (is_array($icon)) { $show['icon'] = true; $thread['threadiconpath'] = $icon['iconpath']; $thread['threadicontitle'] = $icon['title']; } // show goto new post $show['firstnew'] = false; $bbforumview = fetch_bbarray_cookie('forum_view', $thread['forumid']); if ($bbforumview > $bbuserinfo['lastvisit']) { $lastread = $bbforumview; } else { $lastread = $bbuserinfo['lastvisit']; } if ($thread['lastpost'] > $lastread) { $threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']); if ($thread['lastpost'] > $threadview) { $show['firstnew'] = true; $show['icon'] = false; } } exec_switch_bg(); eval("\$threadbits .= \"".fetch_template('forumhome_latestthreadbit')."\";"); } if ($threads) { $show['latestthreads'] = true; } // memory saving unset($thread, $threads); $DB_site->free_result($getthreads); // [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 2 ] Code:
class="smallfont">$upcomingevents</div></td> </tr> </tbody> </if> Code:
<!-- [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] --> <!-- latest threads --> <if condition="$show['latestthreads']"> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_latestthreads')"><img id="collapseimg_forumhome_latestthreads" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_latestthreads].gif" alt="" border="0" /></a> $vbphrase[latest_threads] </td> </tr> </tbody> <tbody id="collapseobj_forumhome_latestthreads" style="$vbcollapse[collapseobj_forumhome_latestthreads]"> <tr> <td class="alt2"> </td> <td class="alt1"><div class="smallfont">$threadbits</div></td> </tr> </tbody> </if> <!-- /latest threads --> <!-- [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] --> I created: forumhome_latestthreadbit Then added the code: Code:
<div class="smallfont"> <if condition="$show['firstnew']"> <a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]&goto=newpost"><img src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a> </if> <if condition="$show['icon'] && !$show['firstnew']"> <img src="$vboptions[bburl]/$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" /> </if> <a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]" title="$thread[preview]"><strong>$thread[title]</strong></a> <em>$vbphrase[last_post]:</em> $thread[date] <if condition="$vboptions['yestoday'] != 2"><span class="time">$thread[time]</span></if> <phrase 1="member.php?$session[sessionurl]find=lastposter&threadid=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase> ? $vbphrase[replies]: $thread[replycount] ? $vbphrase[views]: $thread[views] </div> I then uploaded my index.php and recieved the error. Now on line 460 in DW this is what I see: $thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbc ode(fetch_censored_text($thread['preview']), false, true), $vboptions['threadpreview'])); I don't know if this is the correct line you are looking for. But I'm quite the n00b at this. Please help. |
#155
|
|||
|
|||
PHP Code:
PS DreamWeaver with standard settings is not the best editor for your php-files. |
#156
|
|||
|
|||
i would like to use hack like this but on non-vb page witout vb templates
some thing like the one on www.hotscripts.com but i dont know how to do it exactly so could you explan to me how to do it ? |
#157
|
||||
|
||||
Quote:
|
#158
|
|||
|
|||
There are many good editors around, some payed, some free.
Personally i use UltraEdit, since i know it will work correct on every unix and windows file, and it has some nice code highlighting features (and a lot more). |
#159
|
||||
|
||||
|
#160
|
||||
|
||||
Quote:
|
#161
|
|||
|
|||
HI NTDL
I installed your hack its is beautiful. one thing I found is that you asked to do some changes in index.php, I couldn't find the line of code u mentioned so I checked forum.php and it was there so i did the changes there. But I was expecting to be in my homepage which is the index (advanced cmps) like the other modules. I want it in the home page instead of below the forums. My question is how do iI put it there on my index just like rest such as welcome block etc. Could you please tell me how i can do that thanks |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|