Vedo che il mio thread ha suscitato molto interesse!!
Probabilmente è colpa mia che sono stato un po' vago.
Allora il plugin che ho installato "popin window" in realtà funziona ma soltanto la prima volta!!
In pratica è sufficiente mettere il tag
{popin} all'interno di un articolo e all'apertura di quest'ultimo parte il popup. Come dicevo però una volta chiuso o una volta cambiata pagina il popup non parte più!! Da cosa può dipendere, forse è un problema che si ha solo in locale (localhost) come sto lavorando attualmente io? Provo ad allegare il codice php. Io purtroppo non ci capisco un tubo..
<?php
/**
* @name Joomla Popin
* @description Show a popin window in an article
* @package Joomla 1.6.x
* @author DART Creations spam-me@dart-creations.com http://www.dart-creations.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @version 1.6
*/
/** ensure this file is being included by a parent file */
defined( '_JEXEC' ) or die( 'Go Away!' );
class plgContentjoomlapopin extends JPlugin
{
public function onContentPrepare($context, &$article, &$params, $limitstart)
{
$db =& JFactory::getDBO();
$strpos = JString::strpos( $article->text, 'joomlapopin' );
if ( JString::strpos( $article->text, 'popin' ) === false ) {
return true;
}
// expression to search for
$regex = "#{popin}#s";
if(!isset($_SESSION))
{
session_start();
}
$popinheight = $this->params->get('popinheight');
$popinwidth = $this->params->get('popinwidth');
$leftpos = $this->params->get('leftpos');
$toppos = $this->params->get('toppos');
$resizable = $this->params->get('resizable');
$scrollable = $this->params->get('scrollable');
$html = $this->params->get('html');
$title = $this->params->get('titletext');
$link = $this->params->get('link');
$session = $this->params->get('session');
$userparam = $this->params->get('user');
if ($session == 0)
{
unset($_SESSION['views']);
}
$output = "";
if(!isset($_SESSION['views']))
{
$user =& JFactory::getUser();
$user_id = $user->get('id');
$display = null;
if ($userparam == 0)
{
$display = true;
}
else if ($userparam == 1 && !$user_id)
{
$display = true;
}
else if ($userparam == 2 && $user_id)
{
$display = true;
}
else
{
$display = false;
}
if ($display)
{
$output = "<script type=\"text/javascript\">\nvar pathbase=\"".JURI::Base()."\";\n</script>\n<script type=\"text/javascript\" src=\"plugins/content/joomlapopin/popin/dhtmlwindow.js\"></script>\n".
$output .= "<link rel=\"stylesheet\" href=\"plugins/content/joomlapopin/popin/dhtmlwindow.css\" type=\"text/css\" />\n".
"<div id=\"popincontent\" style=\"display:none\">\n".$html."</div>\n".
//"<div id=\"popincontent\" style=\"clear:both\">\n".$html."</div>\n".
"<script type=\"text/javascript\">\n".
"var divwin=dhtmlwindow.open('divbox', 'div', 'popincontent', '".$title."', 'width=".$popinwidth.",height=".$popinheight.",left=".$leftpos.",top=".$toppos.",resize=".$resizable.",scrolling=".$scrollable."','recal')\n".
"</script>\n";
}
if ($session == 1)
{
$_SESSION['views'] = 1;
}
if ($link == 1)
{
$output .= "<a href=\"http://www.dart-creations.com\" style=\"font-size:1px;display:none;\">Joomla Popin Window by DART Creations[/url]";
}
}
$article->text = preg_replace($regex, $output, $article->text);
}
}
?>
Spero tanto che stavolta il post non passi inosservato!