The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#12
|
||||
|
||||
PHP Code:
|
#13
|
|||
|
|||
freddie:
Thanks. But I still get the parse error at the line it is on. BTW, will this way show old text messages that have already been written or only new posts that have been written since putting this in? Parker |
#14
|
|||
|
|||
so is there a more efficeint way of doing this?
|
#15
|
|||
|
|||
Well:
As stated this was too much of a demand on my server so if you have a large board I would not use this. Anyone have a way to doing this more efficiently? Parker |
#16
|
||||
|
||||
Parker a couple more comments:
1) "$page = $thread[preview];" is redundent. place title="$thread[preview]" in your template. 2) you didn't strip out the bbcodes first, before doing strip_tags. this: Code:
$page = iif(strlen($message)>500,substr($message,0,500).'...',$message); $page=strip_tags($page); Code:
$page = iif(strlen($message)>500,substr($message,0,500).'...',$message); [high]$page=bbcodepase($page);[/high] $page=strip_tags($page); |
#17
|
||||
|
||||
Ah. Small problem that needs to be looked at.
1) If, for example, the first 500 characters of the opening post include something that you as an admin edit out - they will continue to appear in the preview. 2) If, for example, you split a thread then ---> a) the newly created thread will not have a preview; and ---> b) if you, for example, split the thread so as to remove the first post (say, to your trashcan forum), the that post will continue to exist in the 'preview'. What needs to be done, is adding an additional hack code to the editpost script and the splitting action script. In both cases, when a thread is updated, the 'preview' must be updated as well. I'm off to sleep now. I'll see if I can help you when I wake up, if that will be needed |
#18
|
||||
|
||||
OK, the necessary add-ons
1) Open root/editpost.php, find: Code:
if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) { $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]"); //$title=""; } Code:
if ($isfirst) { $page = iif(strlen($message)>500,substr($message,0,500).'...',$message); $page = bbcodeparse($page); $page = strip_tags($page); $DB_site->query("UPDATE thread SET preview='".addslashes(htmlspecialchars($page))."' WHERE threadid=$threadinfo[threadid]"); } 2) open root/postings.php. a) find: Code:
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."',notes='".addslashes($threadinfo[notes])."'$pollcode WHERE threadid='$threadid'"); Code:
[high] $getfirstpost=$DB_site->query_first("SELECT pagetext FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1"); $page = iif(strlen($getfirstpost[pagetext])>500,substr($getfirstpost[pagetext],0,500).'...',$getfirstpost[pagetext]); $page = bbcodeparse($page); $page = strip_tags($page);[/high] $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."',notes='".addslashes($threadinfo[notes])."'[high],preview='".addslashes(htmlspecialchars($page))."'[/high]$pollcode WHERE threadid='$threadid'"); b) find: Code:
// Update first post in each thread as title information in relation to the sames words being in the first post may have changed now. $getfirstpost=$DB_site->query_first("SELECT postid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1"); $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]"); indexpost($getfirstpost[postid]); $getfirstpost=$DB_site->query_first("SELECT postid FROM post WHERE threadid=$newthreadid ORDER BY dateline LIMIT 1"); $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]"); indexpost($getfirstpost[postid]); Code:
// Update first post in each thread as title information in relation to the sames words being in the first post may have changed now. $getfirstpost=$DB_site->query_first("SELECT postid,[high]pagetext[/high] FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1"); $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]"); indexpost($getfirstpost[postid]); [high] $page = iif(strlen($getfirstpost[pagetext])>500,substr($getfirstpost[pagetext],0,500).'...',$getfirstpost[pagetext]); $page = bbcodeparse($page); $page = strip_tags($page); $DB_site->query("UPDATE thread SET preview='".addslashes(htmlspecialchars($page))."' WHERE threadid='$threadid'"); unset($page);[/high] $getfirstpost=$DB_site->query_first("SELECT postid,[high]pagetext[/high] FROM post WHERE threadid=$newthreadid ORDER BY dateline LIMIT 1"); $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]"); indexpost($getfirstpost[postid]); [high] $page = iif(strlen($getfirstpost[pagetext])>500,substr($getfirstpost[pagetext],0,500).'...',$getfirstpost[pagetext]); $page = bbcodeparse($page); $page = strip_tags($page); $DB_site->query("UPDATE thread SET preview='".addslashes(htmlspecialchars($page))."' WHERE threadid='$newthreadid'"); unset($page);[/high] Very nice hack Parker - I personally will use it a lot!!! Thanks, Bira |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|