vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Widget: last articles blogs in CMS - by omardealo (https://vborg.vbsupport.ru/showthread.php?t=239382)

omardealo 03-29-2010 10:00 PM

Widget: last articles blogs in CMS - by omardealo
 
1 Attachment(s)
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

Image:
http://www.7-secret.org/attachment.p...1&d=1269912703

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

PHP Code:

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
PHP Code:

LIMIT 20 

- With the replacement of the name of the selected username
PHP Code:

omardealo 


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

PHP Code:

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
PHP Code:

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

Quote:

Originally Posted by kho91 (Post 2012650)
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

PHP Code:

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.90 

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.

kho91 03-30-2010 05:15 PM

i have the same problem

omardealo 03-31-2010 03:45 AM

Quote:

Originally Posted by karlm (Post 2012962)

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.

Quote:

Originally Posted by kho91 (Post 2012971)
i have the same problem

code 2 working good in my cms
try this

PHP Code:

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

Quote:

Originally Posted by omardealo (Post 2013237)
code 2 working good in my cms
try this

PHP Code:

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.

PHP Code:

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

Quote:

Originally Posted by karlm (Post 2013435)
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
PHP Code:

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
PHP Code:

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.

PHP Code:

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.

PHP Code:

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_
PHP Code:

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:
PHP 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

Quote:

Originally Posted by Exardor (Post 2022218)
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

Quote:

Originally Posted by Exardor (Post 2022218)
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:
PHP 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


All times are GMT. The time now is 05:50 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.01346 seconds
  • Memory Usage 1,847KB
  • 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
  • (16)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete