PDA

View Full Version : vBulletin CMS Widgets - Widget: last articles blogs in CMS - by omardealo


omardealo
03-29-2010, 10:00 PM
Peace and mercy of God be upon you

Widget: last articles blogs in CMS - by omardealo tested on 4.0.2
God willing, also was working on 4.0.1

Programming:
omardealo
7-secret.org (http://7-secret.org)

Image:
http://www.7-secret.org/attachment.php?attachmentid=105&stc=1&d=1269912703 (7-secret.org)

Example:
arabic : http://www.7-secret.org
english : http://www.7-secret.org/content.php?language=en


Code1: Source code for the latest blogs related to a specific username


ob_start();
$blog_get = vB::$db->query_read("
SELECT * from " . TABLE_PREFIX . " blog where username='omardealo' order by dateline DESC LIMIT 20");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<font color="#ff0000"><b>?</b></font><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a></br />
<a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b><br />';
}
$output = $output_bits;
ob_end_clean();


- with the replacement of the number of articles blogs that you want to appear LIMIT 20

- With the replacement of the name of the selected username omardealo


Code2: Source code for the latest articles blogs for all user


ob_start();
$blog_get = vB::$db->query_read("
SELECT * from " . TABLE_PREFIX . " blog order by dateline DESC LIMIT 20");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<font color="#ff0000"><b>?</b></font><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a></br />
<a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b><br />';
}
$output = $output_bits;
ob_end_clean();


- with the replacement of the number of articles blogs that you want to appear LIMIT 20



Composition:

Goto Admincp->vBullietin CMS->Widgets->Create New Widget
Choose PHP Direct Execution as Widget's Type
Place a Title. last articles blogs
Click Save
Click Configure on the right of the new created widget.
Remove the default code that appears. Be sure to not leave behind even a single letter.
Copy and Paste the code that you can find below.
Leave the template name as is (vbcms_widget_execphp_page)
Click Save
Goto Admincp->vBullietin CMS->Layout Manager
Click Go on the Default Layout
Add the Widget to your Layout
Click Save


Source:
http://www.7-secret.org/showthread.php?t=326

hack in arabic - الهاك باللغة العربية:
http://www.7-secret.org/showthread.php?t=325


May God help you do not forget to pray for me and my parents back of the unseen

kho91
03-30-2010, 04:46 AM
i have a sql error tatabase nam don't exist

chokrane akhi

omardealo
03-30-2010, 06:00 AM
i have a sql error tatabase nam don't exist

chokrane akhi

u use code1 or code2
code1 u must replace omardealo to username in ur forum

kho91
03-30-2010, 06:03 AM
code 2

karlm
03-30-2010, 04:57 PM
SELECT * from vb blog order by dateline DESC LIMIT 20;

MySQL Error : Table 'xxxx.vb' doesn't exist
Error Number : 1146
Request Date : Tuesday, March 30th 2010 @ 06:55:21 PM
Error Date : Tuesday, March 30th 2010 @ 06:55:22 PM
Script : http://antimisandry.com/content.php
Referrer : http://antimisandry.com/members/marx/
IP Address : xx.xx.xx.xx
Username : Marx
Classname : vB_Database
MySQL Version : 5.0.90XXXX = My databasename, but I don't see where the .vb got added?
IOW, it's asking for a table called "mydatabasename.vb" which doesn't exist - the only reference to 'mydatabasename' is the database itself, not one of the tables within the database.

kho91
03-30-2010, 05:15 PM
i have the same problem

omardealo
03-31-2010, 03:45 AM
XXXX = My databasename, but I don't see where the .vb got added?
IOW, it's asking for a table called "mydatabasename.vb" which doesn't exist - the only reference to 'mydatabasename' is the database itself, not one of the tables within the database.

i have the same problem

code 2 working good in my cms
try this

ob_start();
$blog_get = vB::$db->query_read("
SELECT * from blog order by dateline DESC LIMIT 20");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<font color="#ff0000"><b>?</b></font><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a></br />
<a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b><br />';
}
$output = $output_bits;
ob_end_clean();

karlm
03-31-2010, 01:20 PM
code 2 working good in my cms
try this

ob_start();
$blog_get = vB::$db->query_read("
SELECT * from blog order by dateline DESC LIMIT 20");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<font color="#ff0000"><b>?</b></font><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a></br />
<a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b><br />';
}
$output = $output_bits;
ob_end_clean();
This code still causes a d/b error.

Database error in vBulletin 4.0.2:

Invalid SQL:

SELECT * from blog order by dateline DESC LIMIT 20;

MySQL Error : Table 'my_database_name.blog' doesn't exist
Error Number : 1146
Request Date : Wednesday, March 31st 2010 @ 03:18:47 PM
Error Date : Wednesday, March 31st 2010 @ 03:18:50 PM
Script : http://antimisandry.com/content/
Referrer : http://antimisandry.com/australian-mens-news/dysfunctional-feminism-strikes-again-29377.html
IP Address : xxxxxxxxxx
Username : xxxxxxxx
Classname : vB_Database
MySQL Version :For some reason, and I'm no coder so can't say why, it is still trying to look up a table called my_database_name instead of an existing table within the database. It makes no sense.
Whereas previously (using code2) it would ask for a table called "my_database_name.vb" it now asks for a table, which also does not exist, called "my_database_name.blog"

omardealo
03-31-2010, 09:04 PM
This code still causes a d/b error.
For some reason, and I'm no coder so can't say why, it is still trying to look up a table called my_database_name instead of an existing table within the database. It makes no sense.
Whereas previously (using code2) it would ask for a table called "my_database_name.vb" it now asks for a table, which also does not exist, called "my_database_name.blog"

sir , my code Queries from table blog
SELECT * from blog order by dateline DESC LIMIT 20;
not from table my_database_name.blog
so I do not know from where comes the name of the table "my_database_name.blog"
if u use tableprefix in config.php this code will work with u well

ob_start();
$blog_get = vB::$db->query_read("
SELECT * from " . TABLE_PREFIX . " blog order by dateline DESC LIMIT 20");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<font color="#ff0000"><b>?</b></font><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a></br />
<a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b><br />';
}
$output = $output_bits;
ob_end_clean();

karlm
04-01-2010, 01:02 AM
Well I do appreciate your efforts, but even a direct copy & paste still kills my d/b, resulting in errors when using this widget.

Database error in vBulletin 4.0.2:

Invalid SQL:

SELECT * from vb blog order by dateline DESC LIMIT 20;

MySQL Error : Table 'XXXX.vb' doesn't exist
Error Number : 1146
Request Date : Thursday, April 1st 2010 @ 02:59:33 AM
Error Date : Thursday, April 1st 2010 @ 02:59:43 AM
Script : http://antimisandry.com/content/
Referrer : http://antimisandry.com/members/yan-yan/
IP Address : **.**.**.**
Username : ----------
Classname : vB_Database
MySQL Version :
I don't understand code too well, so can't really comment on why this is happening... but again, if you note the above error message (received via email moments after testing your latest code offering) - it still claims to be trying to read a table with the name of my database.

karlm
04-01-2010, 01:21 AM
OK, I've just deleted the widget completely and started fresh from scratch - and it still causes D/B errors.

Invalid SQL:

SELECT * from vb blog order by dateline DESC LIMIT 20;

MySQL Error : Table 'XXXXXX.vb' doesn't exist
Error Number : 1146
Request Date : Thursday, April 1st 2010 @ 03:15:57 AM

I'm sorry, but I'm forced to give up on trying. I say so sadly too, because it's a fantastic idea - but it just doesn't seem to be compatible with all versions - or perhaps it's incompatible with another plugin/widget, perhaps?

omardealo
04-01-2010, 09:43 PM
I also can not explain the error, the error The table does not exist
Now I want to know what the names of the tables you have, start for example by vb_
vb_blog
or what ?

Exardor
04-16-2010, 02:54 PM
Got the same error.
Solved it, with deleting of one space between blog and the ".

Sorry for my bad english :D

Here is the (for me working) code:
ob_start();
$blog_get = vB::$db->query_read("
SELECT * from " . TABLE_PREFIX . "blog order by dateline DESC LIMIT 5");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<b>?</b><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a> by <a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b></a><br />';
}
$output = $output_bits;
ob_end_clean();

omardealo
04-30-2010, 03:25 AM
Got the same error.
Solved it, with deleting of one space between blog and the ".

Sorry for my bad english :D

Here is the (for me working) code:


ok . i hope it work good with u now

Brew
08-10-2012, 06:59 PM
Any chance to see this cool mod updated for vb4.2+ ?

Thank you for considering this :)

alhidaya
02-10-2013, 11:47 PM
Got the same error.
Solved it, with deleting of one space between blog and the ".

Sorry for my bad english :D

Here is the (for me working) code:
ob_start();
$blog_get = vB::$db->query_read("
SELECT * from " . TABLE_PREFIX . "blog order by dateline DESC LIMIT 5");
$output_bits = '';
while($blog = vB::$db->fetch_array($blog_get))
{
$output_bits .= '<b>?</b><a href="blog.php?b='.$blog[blogid].'">'.$blog[title].'</a> by <a href="member.php?u='.$blog[userid].'"><b>'.$blog[username].'</b></a><br />';
}
$output = $output_bits;
ob_end_clean();


Hello,

Thank you Exador