The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
VB Most Viewed Article Widget
Hey, I need to create a Widget that will display the most view CMS articles in the sidebar. I've tried to use the code here https://vborg.vbsupport.ru/showthread.php?t=240904
PHP Code:
Does anyone have some code for me, not a programmer at all, so I need something I can just cut and paste. Please help. |
#2
|
||||
|
||||
If that one is for a week, and you want for all time, you need to remove the part that queries based on the time:
PHP Code:
|
#3
|
|||
|
|||
Quote:
Okay, so I've removed the PHP Code:
PHP Code:
to test it. Could someone please tell me why it still shows nothing. Any help is extremely welcome. |
#4
|
||||
|
||||
Is that all that you put into the widget? If so, you are right - it's not going to work. All you've done is a select statement. You've done nothing with the results at all. You should go download some other widgets from here that query the database and see how they then take the results and spit them out into the widget. (And you should not need to do any ob_start or ob_end type statements.)
edit: Oh, I see you posted all of it in the first post. Still, no ob_stuff needed. Also, the format for class is class="something" No spaces around the equal sign. |
#5
|
|||
|
|||
Quote:
PHP Code:
PHP Code:
Where do I add PHP Code:
--------------- Added [DATE]1291114050[/DATE] at [TIME]1291114050[/TIME] --------------- Okay, rewrote, finally fixed it. For anyone that wants to show the articles with the highest views of all time in a widget, here's the code. PHP Code:
|
#6
|
|||
|
|||
It's working great for me too!
Do you guys know a way to show the articles only of a few sections? Many thanks! |
#7
|
||||
|
||||
You would need to add to the WHERE clause in the query something like AND cms_node.nodeid = x where x is that section. Or AND cms_node.nodeid IN (x,y,z)
|
#8
|
|||
|
|||
Thanks Lynne. But I know nothing about php so I can't do it. Could you help me?
|
#9
|
|||
|
|||
This works perfect , Thanks subojac !!
Can you please tell me i i can add a separator line for titles and a bullet ? Cheers ! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|