vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vB News Ticker (https://vborg.vbsupport.ru/showthread.php?t=123126)

davidw 08-07-2006 04:03 PM

ok, try this then in the plugin, find this:

PHP Code:

            $gettickers $db->query_read("
                SELECT t.threadid, t.title, t.lastpost, t.forumid, t.open, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, t.visible, t.firstpostid, f.title AS forumtitle 
                FROM " 
TABLE_PREFIX "forum f 
                INNER JOIN " 
TABLE_PREFIX "thread t ON t.forumid = f.forumid AND t.visible = 1 AND " $desclim " > ( SELECT count(" $desclim ") FROM " TABLE_PREFIX "thread WHERE forumid = f.forumid AND visible = 1 AND dateline > t.dateline )
                LEFT OUTER JOIN " 
TABLE_PREFIX "post AS post ON post.postid = t.firstpostid WHERE t.forumid IN (" implode(','$tickarray) . ") 
                ORDER BY field(f.forumid," 
implode(','$tickarray) . "), t.dateline desc
            "
); 

and replace with this
PHP Code:

            $gettickers $db->query_read("
                SELECT t.threadid, t.title, t.forumid, t.open, t.dateline, t.visible, t.firstpostid 
                FROM " 
TABLE_PREFIX "forum f 
                INNER JOIN " 
TABLE_PREFIX "thread t ON t.forumid = f.forumid AND t.visible = 1 AND " $desclim " > ( SELECT count(" $desclim ") FROM " TABLE_PREFIX "thread WHERE forumid = f.forumid AND visible = 1 AND dateline > t.dateline )
                LEFT OUTER JOIN " 
TABLE_PREFIX "post AS post ON post.postid = t.firstpostid WHERE t.forumid IN (" implode(','$tickarray) . ") 
                ORDER BY field(f.forumid," 
implode(','$tickarray) . "), t.dateline desc
            "
); 

and then find this
PHP Code:

                $ticker['title']        = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\,\&gt;\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$ticker['title']);
                
$ticker['title']        = fetch_trimmed_title(fetch_censored_text(unhtmlspecialchars($ticker['title'])), $titlelim);
                
$ticker['date']            = vbdate($vbulletin->options['dateformat'], $ticker['dateline']);
                
$ticker['time']            = vbdate($vbulletin->options['timeformat'], $ticker['dateline']);
                
$ticker['replycount']    = vb_number_format($ticker['replycount']);
                
$ticker['views']        = vb_number_format($ticker['views']); 

and replace with this:
PHP Code:

                $ticker['title']        = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\,\&gt;\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$ticker['title']);
                
$ticker['title']        = fetch_trimmed_title(fetch_censored_text(unhtmlspecialchars($ticker['title'])), $titlelim);
                
$ticker_titles             .= '<a href="showthread.php?t='$ticker['threadid'] .'" title="'$ticker['title'] .'" target="blank">'$ticker['title'] .'</a> '$ticksep.''


VaaKo 08-07-2006 04:59 PM

Thank you for taking my rewuest into consideration.
However, I'm getting this error when I installed it.

Code:

Database error in vBulletin 3.5.4:

Invalid SQL:

                                SELECT t.threadid, t.title, t.lastpost, t.forumid, t.open, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, t.visible, t.firstpostid, f.title AS forumtitle
                                FROM forum f
                                INNER JOIN thread t ON t.forumid = f.forumid AND t.visible = 1 AND 10 > ( SELECT count(10) FROM thread WHERE forumid = f.forumid AND visible = 1 AND dateline > t.dateline )
                                LEFT OUTER JOIN post AS post ON post.postid = t.firstpostid WHERE t.forumid IN (0,0,0,0,0,0,0,0,0)
                                ORDER BY field(f.forumid,0,0,0,0,0,0,0,0,0), t.dateline desc;

MySQL Error  : You have an error in your SQL syntax near 'SELECT count(10) FROM thread WHERE forumid = f.forumid AND visible = 1 AND datel' at line 4
Error Number : 1064
Date        : Tuesday, August 8th 2006 @ 12:07:32 AM
Script      : http://www.onelebanon.com/forum/index.php
Referrer    : http://www.onelebanon.com/forum/index.php
IP Address  : 82.198.0.27
Username    : Golani
Classname    : vb_database

:(

davidw 08-07-2006 05:24 PM

What do you have for your first forumid? it looks like 0. You need something for your forumid. Also, you may want to edit your code to remove your IP address and username.

Also, what version of SQL are using? This will only run on 4.1 or higher.

bhxtyrant 08-07-2006 07:12 PM

Hey christianb,i was wondering does this version only work with 3.5.5 or will it work ok with 3.5.4 as well?I tried installing it but i cant seem to get it working with 3.5.4 is there a version of this mod for 5.4?

davidw 08-07-2006 07:15 PM

Yes, it does work with 3.5.4 (that's what I'm running). What kind of problem are you seeing?

bhxtyrant 08-07-2006 07:17 PM

I think it may be due to me trying to use it in the header template rather then ForumHome as my ticker area is in the header,When i add the approriate mod and import the xml i set the forum id to "2" and set height width ect but nothing shows in the area at all.

Eagle Creek 08-07-2006 07:17 PM

Quote:

Originally Posted by christianb
I got mine up to 1.699seconds (in firefox) - try this - I removed a bunch of stuff that needn't be used (things I had from a query that I'm using for a hack I'm going to release later this week).

Try this one out - if this works, I'll update the hack today - which it possibly could. I disabled my vbshout and installed this and shaved 70% off my delay.

Still slow as * :(.

Quote:

Originally Posted by christianb
ok, try this then in the plugin, find this:

PHP Code:

            $gettickers $db->query_read("
                SELECT t.threadid, t.title, t.lastpost, t.forumid, t.open, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, t.visible, t.firstpostid, f.title AS forumtitle 
                FROM " 
TABLE_PREFIX "forum f 
                INNER JOIN " 
TABLE_PREFIX "thread t ON t.forumid = f.forumid AND t.visible = 1 AND " $desclim " > ( SELECT count(" $desclim ") FROM " TABLE_PREFIX "thread WHERE forumid = f.forumid AND visible = 1 AND dateline > t.dateline )
                LEFT OUTER JOIN " 
TABLE_PREFIX "post AS post ON post.postid = t.firstpostid WHERE t.forumid IN (" implode(','$tickarray) . ") 
                ORDER BY field(f.forumid," 
implode(','$tickarray) . "), t.dateline desc
            "
); 

and replace with this
PHP Code:

            $gettickers $db->query_read("
                SELECT t.threadid, t.title, t.forumid, t.open, t.dateline, t.visible, t.firstpostid 
                FROM " 
TABLE_PREFIX "forum f 
                INNER JOIN " 
TABLE_PREFIX "thread t ON t.forumid = f.forumid AND t.visible = 1 AND " $desclim " > ( SELECT count(" $desclim ") FROM " TABLE_PREFIX "thread WHERE forumid = f.forumid AND visible = 1 AND dateline > t.dateline )
                LEFT OUTER JOIN " 
TABLE_PREFIX "post AS post ON post.postid = t.firstpostid WHERE t.forumid IN (" implode(','$tickarray) . ") 
                ORDER BY field(f.forumid," 
implode(','$tickarray) . "), t.dateline desc
            "
); 

and then find this
PHP Code:

                $ticker['title']        = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\,\&gt;\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$ticker['title']);
                
$ticker['title']        = fetch_trimmed_title(fetch_censored_text(unhtmlspecialchars($ticker['title'])), $titlelim);
                
$ticker['date']            = vbdate($vbulletin->options['dateformat'], $ticker['dateline']);
                
$ticker['time']            = vbdate($vbulletin->options['timeformat'], $ticker['dateline']);
                
$ticker['replycount']    = vb_number_format($ticker['replycount']);
                
$ticker['views']        = vb_number_format($ticker['views']); 

and replace with this:
PHP Code:

                $ticker['title']        = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\,\&gt;\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$ticker['title']);
                
$ticker['title']        = fetch_trimmed_title(fetch_censored_text(unhtmlspecialchars($ticker['title'])), $titlelim);
                
$ticker_titles             .= '<a href="showthread.php?t='$ticker['threadid'] .'" title="'$ticker['title'] .'" target="blank">'$ticker['title'] .'</a> '$ticksep.''



Do I have to try these things also?

Eagle Creek 08-07-2006 07:21 PM

EDIT:

Made the changes but not any differences..

davidw 08-07-2006 07:26 PM

@bhxtyrant - it won't work, as far as I know, in the header. It will only work in the forumhome template.

@Eagle Creek - Those are the same changes in the product I posted earlier for you. Those changes are to be made in the plugin. If you go to your Plugin System => Plugin Manager => find vB News Ticker under forumhome_complete and click on [Edit] on the right side - it will give you the option to edit the plugin.

Eagle Creek 08-07-2006 07:30 PM

I think there is something really wrong with your code.

It just take up to 20 seconds?


All times are GMT. The time now is 01:04 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.01406 seconds
  • Memory Usage 1,810KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete