The is just a quick article with some examples for creating a Custom HTML/PHP Forum Block
Creating an HTML Block
To create the block:
AdminCP > Forums & Moderators > Forum Blcoks Manager > Add Block
Select Block Type: Custom HTML/PHP
CONTINUE
Title: whatever you want
Cache Time (in minutes): whatever you want
Active: Yes
Content Type: HTML
Content: examples shown below
Template to Use: block_html
SAVE
Examples for Content for an HTML Block:
Text:
An image:
Youtube Video[/B]:
Creating a PHP Block
To create the block:
AdminCP > Forums & Moderators > Forum Blcoks Manager > Add Block
Select Block Type: Custom HTML/PHP
CONTINUE
Title: whatever you want
Cache Time (in minutes): whatever you want
Active: Yes
Content Type: PHP
Content: examples shown below
Template to Use: block_html
SAVE
Examples for Content for a PHP Block:
Text:
Using a Variable:
Using a query:
If you need help writing the code for one of these widgets, you should request help over on vbulletin.org, the modification site.
Creating an HTML Block
To create the block:
AdminCP > Forums & Moderators > Forum Blcoks Manager > Add Block
Select Block Type: Custom HTML/PHP
CONTINUE
Title: whatever you want
Cache Time (in minutes): whatever you want
Active: Yes
Content Type: HTML
Content: examples shown below
Template to Use: block_html
SAVE
Examples for Content for an HTML Block:
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[/B]:
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 Block
To create the block:
AdminCP > Forums & Moderators > Forum Blcoks Manager > Add Block
Select Block Type: Custom HTML/PHP
CONTINUE
Title: whatever you want
Cache Time (in minutes): whatever you want
Active: Yes
Content Type: PHP
Content: examples shown below
Template to Use: block_html
SAVE
Examples for Content for a PHP Block:
Text:
PHP Code:
$my_output = 'Hello, world.';
return $my_output;
Using a Variable:
PHP Code:
$my_output = '<p>Hello '. vB::$vbulletin->userinfo[username].'</p>';
return $my_output;
Using a query:
PHP Code:
$my_output = "Hello ". vB::$vbulletin->userinfo['username'];
$my_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>';
$my_output .= "<br />" . $threadurl;
return $my_output;
If you need help writing the code for one of these widgets, you should request help over on vbulletin.org, the modification site.