lol just noticed auto correct changed the first hook into food xDhowdy all , i have found how to food into individual things like thread/forum etc but how can i hook a custom controller to show on index page of forum or every page
<?php
class RRWS_RPMarket_Listener_Ad
{
public static function getString(array &$params, XenForo_Dependencies_Abstract $dependencies)
{
// Run Queries on the Database
$advertNum = rand(1,4);
$advertQuery = $db->fetchAll("SELECT * FROM `xf_advert_rp` WHERE `ad_id` = $advertNum");
$params = array('advertParam' => $advertQuery);
}
}
?>
array(1) {
[0] => array(5) {
["ad_id"] => int(1)
["ad_title"] => string(10) "Test Title"
["ad_text"] => string(12) "Test Message"
["ad_image"] => NULL
["ad_owner"] => string(7) "Richard"
}
}
Hi,Made some progress on this but hit a roadblock. when using this code
PHP:<?php class RRWS_RPMarket_Listener_Ad { public static function getString(array &$params, XenForo_Dependencies_Abstract $dependencies) { // Run Queries on the Database $advertNum = rand(1,4); $advertQuery = $db->fetchAll("SELECT * FROM `xf_advert_rp` WHERE `ad_id` = $advertNum"); $params = array('advertParam' => $advertQuery); } } ?>
However it kills off all ajax/java functions on site when enabled, can you spot my mistake?
works perfectly now! thanks @Lawrence.
btw you may get a kick out of my use for this, its to allow in character adverts for the role plays on my site
aka
"Visit the Starlight Inn"
Best prices and least chance of death anywhere near the darklands! just alittle fun thing for the writers![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.