mercredi 28 août 2013

joomla display a module inside a component

Sometimes you need to include rendered HTML code of a joomla module inside a joomla component usaully in view file located under tmpl folder, this 3 lines can help (tested on jommla 3.1)

$module = JModuleHelper::getModule('mod_paidsystem_random');
$moduleHtml = JModuleHelper::renderModule($module);
echo $moduleHtml;

this will display the mod_paidsystem_random module inline in the component

vendredi 16 août 2013

php twitter followers count and facebook likes count without login

Numbers of likes on facebook page
         $name = 'PAGE';
         $src = json_decode(file_get_contents(''.$name));
    $likes= $src->likes;
echo $likes;

Twitter  code is different i've found this hack on the web (y)
with the code below no need to connect with valid credentials:

$src = file_get_contents($url);
$decoded = json_decode($src);
echo ($decoded->query->results->strong[2]);

where XXXXXXX is the account
it works tested on a joomla integration.