<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Modifica al codice di un plugin]]></title><description><![CDATA[<p dir="auto">Ciao a tutti, avrei un problema con il codice di un plugin inserito sul mio sito<br />
che permette all'utente di copiare un codice  <a href="http://www.giorgiotave.it/forum/../wikigt/os/Hyper_Text_Markup_Language" rel="nofollow ugc">html</a> da poter incollare sul proprio  <a href="http://www.giorgiotave.it/forum/../wikigt/os/Blog" rel="nofollow ugc">blog</a> o sito per inserire una breve citazione dell'articolo.<br />
Potete vederne un esempio <a href="http://testing.visualclinic.fr/component/content/article/1-latest-news/1-welcome-to-joomla.html?directory=55" rel="nofollow ugc">qui</a> cliccando sul  <a href="http://www.giorgiotave.it/forum/../wikigt/os/Link" rel="nofollow ugc">link</a> quot this article alla fine dell'articolo.<br />
Il problema come potete vedere è che per mostrare il codice occorre cliccare sul link, mentre io vorrei che questo fosse sempre visibile. Sapreste dirmi come modificare il codice affinchè il codice da copiare o incollare venga reso sempre visibile? Posto di seguito il codice del plugin:</p>
<pre><code>&lt;?php
/**
 * @version        $Id: quothis.php 10094 2008-06-03  $
 * @package        QuotThis
 * @copyright    Copyright (C) 2008 - Bernard Gilly. All rights reserved.
 * @license        GNU/GPL
 * @Website     http://www.alphaplug.com
 */

// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.plugin.plugin' );

class plgContentQuotethis extends JPlugin
{

    function plgContentQuotethis( &amp;$subject, $params )
    {
        parent::__construct( $subject, $params );
    }

    function onPrepareContent( &amp;$article, &amp;$params, $limitstart )
    {
        global $mainframe;
        
        $document    = &amp; JFactory::getDocument();
        $view        = JRequest::getCmd('view');
        
        if ( $view != 'article' ) return;        

        // Get plugin info
        $plugin              =&amp; JPluginHelper::getPlugin('content', 'quotethis');
        $pluginParams        = new JParameter( $plugin-&gt;params );
        $excludeSectionID    = $pluginParams-&gt;get( 'excludeSectionID',  '' );        
        $excludeCategoryID   = $pluginParams-&gt;get( 'excludeCategoryID', '' );
        $excludeID           = $pluginParams-&gt;get( 'excludeID',         '' );        
        $listexcludeSection  = @explode ( ",",  $excludeSectionID );    
        $listexcludeCategory = @explode ( ",", $excludeCategoryID );    
        $listexclude          = @explode ( ",",         $excludeID );        
        
        if ( $params-&gt;get( 'intro_only' ) || in_array ( $article-&gt;id, $listexclude ) || in_array ( $article-&gt;sectionid, $listexcludeSection ) || in_array ( $article-&gt;catid, $listexcludeCategory ) ) return;    
        
        JPlugin::loadLanguage( 'plg_quotethis', JPATH_ADMINISTRATOR );
        
        $loadMootools     = $pluginParams-&gt;def( 'loadMootools',           1 );
        $preview            = $pluginParams-&gt;def( 'preview',                1 );
        $txtcols         = $pluginParams-&gt;def( 'txtcols',               54 );
        $txtrows         = $pluginParams-&gt;def( 'txtrows',                7 );    
        $rowtitle        = $pluginParams-&gt;def( 'title',            'title' );        
        $intro           = $pluginParams-&gt;def( 'intro',                '0' );
        $limitcharintro  = $pluginParams-&gt;def( 'limitcharintro',     '150' );
        $showfirstimage  = $pluginParams-&gt;def( 'showfirstimage',       '0' );
        $widthimage         = $pluginParams-&gt;def( 'widthimage',         '120' );        
        $copyright       = $pluginParams-&gt;def( 'copyright',            '1' );
        $showdate        = $pluginParams-&gt;def( 'showdate',             '1' );    
        $width           = $pluginParams-&gt;def( 'width',                400 );
        $colorborder     = $pluginParams-&gt;def( 'colorborder',     '456B8F' );
        $backgroundcolor = $pluginParams-&gt;def( 'backgroundcolor', 'FFFFFF' );
        $fontsizetitle   = $pluginParams-&gt;def( 'fontsizetitle',       '13' );
        $colortitle      = $pluginParams-&gt;def( 'colortitle',      '003399' );
        $colortitlehover = $pluginParams-&gt;def( 'colortitlehover', 'FF9900' );
        $fontsize        = $pluginParams-&gt;def( 'fontsize',            '10' );
        $fontcolor       = $pluginParams-&gt;def( 'fontcolor',       '222222' );            
        
        //unset($document-&gt;_scripts[JURI::base(true) . '/media/system/js/mootools.js']);
        //unset($document-&gt;_scripts[JURI::base(true) . '/media/system/js/mootools-uncompressed.js']);
        //$document-&gt;addScript(JURI::base(true) . '/media/system/js/mootools.js');        
        if ( $loadMootools ) $document-&gt;addScript(JURI::base(true).'/plugins/content/quotethis/js/mootools.js');                
        
        $uri             =&amp; JURI::getInstance();
        $base            = $uri-&gt;toString( array('scheme', 'host', 'port'));        
        $thequote        = $base.JRoute::_(ContentHelperRoute::getArticleRoute($article-&gt;slug, $article-&gt;catslug, $article-&gt;sectionid));        

        $copyNow         = date('Y');
        $title           = stripslashes( $article-&gt;$rowtitle );
        $copyright       = ( $copyright ) ? "&amp;copy; " . $copyNow . " - " : "" ;
        $thedate         = ( $showdate )  ? "&lt;br /&gt;" . JHTML::_( 'date', $article-&gt;created, JText::_('DATE_FORMAT_LC')) : "" ;
        $introtext         = ( $intro )     ? "&lt;br /&gt;" . plgContentQuotethis::prepareIntroQuoteThis( $article-&gt;text, $limitcharintro, "" ) : "" ;
        $image              = "";
        
        if ( $showfirstimage ) {
            $image = plgContentQuotethis::findIMGquotethis( $article-&gt;text );
            $image = "&lt;img src=\"" . $image . "\" width=\"" . $widthimage . "\" alt=\"\" /&gt;";
            $image = "&lt;div style=\"float:left;padding:5px;\"&gt;" . $image . "&lt;/div&gt;";
        }
        
        $style4quote = "&lt;style type=\"text/css\"&gt;&lt;!--"
        .".quote {width:".$width."px; padding: 6px; border: solid 1px #".$colorborder."; font: ".$fontsize."px helvetica, verdana, sans-serif; color: #".$fontcolor."; background-color: #".$backgroundcolor."}"
        .".quote a {font: ".$fontsizetitle."px arial, serif; color: #".$colortitle."; text-decoration: underline}"
        .".quote a:hover {color: #".$colortitlehover."; }"
        ."//--&gt;&lt;/style&gt;";

        $javascript = "\n&lt;script language=\"JavaScript\" type=\"text/javascript\"&gt;\n&lt;!--\n"
            ."window.addEvent('domready', function(){\n"
            ."var mySlide = new Fx.Slide('quotethisexpand').hide();    \n"
            ."$('toggle').addEvent('click', function(e){\n"
            ."e = new Event(e);\n"
            ."mySlide.toggle();\n"
            ."e.stop();\n"
            ."});\n"
            ."}); \n//--&gt;"
            ."&lt;/script&gt;\n";
            
        if ( $preview ) $document-&gt;addCustomTag( $style4quote );
            
        $html  = $javascript;        
        $html .= "&lt;a id=\"toggle\" href=\"#\"&gt;" . JText::_('QUOTETHISARTICLEONYOURSITE') . "&lt;/a&gt;";
        $html .= "&lt;br /&gt;&lt;div id=\"quotethisexpand\"&gt;&lt;br /&gt;";
        $html .= "&lt;strong&gt;".JText::_('CREATELINKTOWARDSTHISARTICLE')."&lt;/strong&gt;";
        $html .= "&lt;br /&gt;&lt;br /&gt;";        
        $html .= "&lt;textarea name=\"textarea\" cols=\"$txtcols\" rows=\"$txtrows\"&gt;".$style4quote.$image."&lt;div class=\"quote\"&gt;"
        ."&lt;a href=\"" . $thequote ."\" target=\"_blank\"&gt;" . $title . "&lt;/a&gt;" . $thedate . $introtext
        ."&lt;div align=\"right\" style=\"width:".$width."px\"&gt;&lt;p style=\"text-align:right;\"&gt;".$copyright."&lt;a href=\"".JURI::base()."\" target=\"_blank\"&gt;".$mainframe-&gt;getCfg('sitename')."&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/textarea&gt;";
        $html .= "&lt;br /&gt;&lt;br /&gt;";
        
        if ( $preview ) {
            $html .= JText::_('PREVIEWQUOTE');
            $html .= "&lt;br /&gt;&lt;br /&gt;";
            $html .= $style4quote;
            $html .= $image . "&lt;div class=\"quote\"&gt;\n&lt;a href=\"$thequote\" target=\"_blank\"&gt;$title&lt;/a&gt;"
            .$thedate.$introtext
            ."\n&lt;div align=\"right\" style=\"width:".$width."px\"&gt;&lt;p style=\"text-align:right;\"&gt;$copyright&lt;a href=\"".JURI::base()."\" target=\"_blank\"&gt;".$mainframe-&gt;getCfg('sitename')."&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;";
            $html .= "&lt;br /&gt;";        
        }
        $html .= "&lt;div class=\"small\" align=\"center\"&gt;";
        // This software is copyrighted: don't remove the copyright notice
        $html .= "Powered by &lt;a href=\"http://www.alphaplug.com\"&gt;QuoteThis&lt;/a&gt; &amp;copy; 2008";
        $html .= "&lt;/div&gt;";
        $html .= "&lt;/div&gt;";
            
        $article-&gt;text = $article-&gt;text . $html;

    }
    
    function prepareIntroQuoteThis( $text, $length=150, $tags='' ) {
        // strips tags won't remove the actual jscript
        $text = preg_replace( "'&lt;script[^&gt;]*&gt;.*?&lt;/script&gt;'si", "", $text );
        $text = preg_replace( '/{.+?}/', '', $text);
        // replace line breaking tags with whitespace
        $text = preg_replace( "'&lt;(br[^/&gt;]*?/|hr[^/&gt;]*?/|/(div|h[1-6]|li|p|td))&gt;'si", ' ', $text );
    
        return html_entity_decode(plgContentQuotethis::smartSubstrQuoteThis( strip_tags( $text, $tags ), $length ));
    }
    
    function smartSubstrQuoteThis($text, $length=150) {
        if ( strlen($text) &gt; $length ) {     
            $text = substr( $text, 0, $length );
            $blankpos = strrpos( $text, ' ' );    
            $text = substr( $text, 0, $blankpos );    
            $text .= "...";
        }  
        return $text;  
    }
    
    function findIMGquotethis( $contenttext ) {    
        $image = "";
        if ( preg_match_all('#src="(.*)"#Uis', $contenttext, $match ) ) {
            if ( count($match) ) {
                $image = $match[1][0];
            }
        }
        return $image;
    }    
}
?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/101958/modifica-al-codice-di-un-plugin</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 04:22:34 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/101958.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 May 2009 14:27:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Modifica al codice di un plugin on Sun, 24 May 2009 21:49:46 GMT]]></title><description><![CDATA[<p dir="auto">Risolto.<br />
Grazie mille dell'aiuto sydarex</p>
]]></description><link>https://dev.connect.gt/post/832428</link><guid isPermaLink="true">https://dev.connect.gt/post/832428</guid><dc:creator><![CDATA[bill152]]></dc:creator><pubDate>Sun, 24 May 2009 21:49:46 GMT</pubDate></item><item><title><![CDATA[Reply to Modifica al codice di un plugin on Sat, 23 May 2009 07:44:55 GMT]]></title><description><![CDATA[<p dir="auto">E' normale, devi fare l'escape dei " nella stringa:</p>
<pre><code>$html .= "Powered by &lt;a href=\"non_sono_premium\"rel=[B]\"nofollow\"&gt;[/B]QuoteThis&lt;/a&gt; &amp;copy; 2008";
</code></pre>
]]></description><link>https://dev.connect.gt/post/832421</link><guid isPermaLink="true">https://dev.connect.gt/post/832421</guid><dc:creator><![CDATA[sydarex]]></dc:creator><pubDate>Sat, 23 May 2009 07:44:55 GMT</pubDate></item><item><title><![CDATA[Reply to Modifica al codice di un plugin on Fri, 22 May 2009 17:05:03 GMT]]></title><description><![CDATA[<p dir="auto">Alla riga 264 al posto di<br />
$html .= "Powered by &lt;a href="<a href="http://www.alphaplug.com" rel="nofollow ugc">http://www.alphaplug.com</a>"&gt;QuoteThis&lt;/a&gt; <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/00a9.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--copyright" style="height:1.4em;width:auto;vertical-align:middle" title="©" alt="©" /> 2008";</p>
<p dir="auto">ho messo</p>
<p dir="auto">$html .= "Powered by &lt;a href="<a href="http://www.alphaplug.com" rel="nofollow ugc">http://www.alphaplug.com</a>"rel="nofollow"&gt;QuoteThis&lt;/a&gt; <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/00a9.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--copyright" style="height:1.4em;width:auto;vertical-align:middle" title="©" alt="©" /> 2008";</p>
<p dir="auto">Con tale modifica però il sito non si carica più correttamente.</p>
]]></description><link>https://dev.connect.gt/post/832453</link><guid isPermaLink="true">https://dev.connect.gt/post/832453</guid><dc:creator><![CDATA[bill152]]></dc:creator><pubDate>Fri, 22 May 2009 17:05:03 GMT</pubDate></item><item><title><![CDATA[Reply to Modifica al codice di un plugin on Fri, 22 May 2009 15:17:47 GMT]]></title><description><![CDATA[<p dir="auto">Puoi spiegarti maglio? Non ho capito il problema.</p>
]]></description><link>https://dev.connect.gt/post/832423</link><guid isPermaLink="true">https://dev.connect.gt/post/832423</guid><dc:creator><![CDATA[sydarex]]></dc:creator><pubDate>Fri, 22 May 2009 15:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to Modifica al codice di un plugin on Fri, 22 May 2009 12:36:28 GMT]]></title><description><![CDATA[<p dir="auto">Scusa un'altra cosa? C'è qualche problema nell'inserire l'attributo rel="nofollow" in un link nel codice mostrato, perchè facendolo il sito non mi sia apre più correttamente (carica una pagina bianca)</p>
]]></description><link>https://dev.connect.gt/post/832451</link><guid isPermaLink="true">https://dev.connect.gt/post/832451</guid><dc:creator><![CDATA[bill152]]></dc:creator><pubDate>Fri, 22 May 2009 12:36:28 GMT</pubDate></item><item><title><![CDATA[Reply to Modifica al codice di un plugin on Fri, 22 May 2009 11:53:57 GMT]]></title><description><![CDATA[<p dir="auto">Ciao sups e grazie mille per il suggerimento, sono riuscito nel mio intento<br />
A presto!</p>
]]></description><link>https://dev.connect.gt/post/832439</link><guid isPermaLink="true">https://dev.connect.gt/post/832439</guid><dc:creator><![CDATA[bill152]]></dc:creator><pubDate>Fri, 22 May 2009 11:53:57 GMT</pubDate></item><item><title><![CDATA[Reply to Modifica al codice di un plugin on Fri, 22 May 2009 07:54:20 GMT]]></title><description><![CDATA[<p dir="auto">Così a prima vista direi di commentare in questo modo lo script:</p>
<pre><code class="language-php">/* $javascript = "\n&lt;script language=\"JavaScript\" type=\"text/javascript\"&gt;\n&lt;!--\n"
    ."window.addEvent('domready', function(){\n"
    ."var mySlide = new Fx.Slide('quotethisexpand').hide();    \n"
    ."$('toggle').addEvent('click', function(e){\n"
    ."e = new Event(e);\n"
    ."mySlide.toggle();\n"
    ."e.stop();\n"
    ."});\n"
    ."}); \n//--&gt;"
    ."&lt;/script&gt;\n"; */
    
//$html  = $javascript;        
//$html .= "&lt;a id=\"toggle\" href=...";
$html = "&lt;a id=\"toggle\" href=...";
</code></pre>
<p dir="auto">Ciao!</p>
]]></description><link>https://dev.connect.gt/post/832436</link><guid isPermaLink="true">https://dev.connect.gt/post/832436</guid><dc:creator><![CDATA[sups]]></dc:creator><pubDate>Fri, 22 May 2009 07:54:20 GMT</pubDate></item></channel></rss>