The is just a quick article with some examples for creating Static HTML and PHP Direct Execution Widgets
Creating a Static HTML Widget
First, create the widget:
AdminCP > vBulletin CMS > Widgets > Create New Widget
Widget Type: Static HTML
Title: whatever you want
SAVE
Now, find your widget in the list and click on Configure Next to it and enter valid HTML into the text area there.
Examples of HTML Widgets:
Text:
An image:
Youtube Video:
Creating a PHP Direct Execution Widget
First, create the widget:
AdminCP > vBulletin CMS > Widgets > Create New Widget
Widget Type: PHP Direct Execution Widget
Title: whatever you want
SAVE
Now, find your widget in the list and click on Configure Next to it and enter valid PHP into the text area there.
Examples of PHP Direct Execution Widgets:
Text:
Using a Variable:
Using a query:
Note: Depending on what your widget does, you may want to change the setting "Cache refresh time (minutes)" on the Configure screen also.
If you need help writing the code for one of these widgets, you should request help over on vbulletin.org, the modification site.
Creating a Static HTML Widget
First, create the widget:
AdminCP > vBulletin CMS > Widgets > Create New Widget
Widget Type: Static HTML
Title: whatever you want
SAVE
Now, find your widget in the list and click on Configure Next to it and enter valid HTML into the text area there.
Examples of HTML Widgets:
Text:
HTML Code:
<p>Hello World</p>
An image:
HTML Code:
<img src="http://www.vbulletin.com/forum/images/misc/vbulletin4_logo.png" alt="" />
Youtube Video:
HTML Code:
<object width="240" height="240"><param name="movie" value="http://www.youtube.com/v/GpcJNEWKzCY&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GpcJNEWKzCY&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="240" height="240"></embed></object> <br />
Creating a PHP Direct Execution Widget
First, create the widget:
AdminCP > vBulletin CMS > Widgets > Create New Widget
Widget Type: PHP Direct Execution Widget
Title: whatever you want
SAVE
Now, find your widget in the list and click on Configure Next to it and enter valid PHP into the text area there.
Examples of PHP Direct Execution Widgets:
Text:
PHP Code:
$output = "Hello World";
PHP Code:
$output = "Hello ". vB::$vbulletin->userinfo['username'];
$output .= "<br />How are you today?";
PHP Code:
$output = "Hello ". vB::$vbulletin->userinfo['username'];
$output .= "<br />Your last post was in this thread:";
$myquery = vB::$db->query_first("
SELECT
post.threadid, thread.title
FROM " . TABLE_PREFIX . "post AS post
INNER JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)
WHERE post.userid = ".vB::$vbulletin->userinfo['userid']. "
ORDER BY post.dateline DESC
");
$threadurl = '<a href="' . fetch_seo_url(thread, $myquery) . '" title="'. $myquery[title] .'">'. $myquery[title] .'</a>';
$output .= "<br />" . $threadurl;
If you need help writing the code for one of these widgets, you should request help over on vbulletin.org, the modification site.