Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
  1. La community italiana di SEO, marketing digitale e AI
  2. Categorie
  3. Coding e Sistemistica
  4. Coding
  5. Centrare testo php

Centrare testo php

Pianificato Fissato Bloccato Spostato Coding
2 Post 1 Autori 1.6k Visualizzazioni 1 Seguito
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • B
    B
    bill152
    scritto su ultima modifica di
    User Attivo 0
    #1
    Centrare testo php

    Ciao a tutti. Inanzitutto confesso la mia ignoranza in materia di php.
    Avrei un probema con un plugin che ho installato sul mio sito in joomla. Questo permette di prendere un codice html da inserire sul proprio blog o sito per mettere un collegamento con immagine e descrizione ai giochi pubblicati sul mio sito. Potete vederne un esempio qui: http://www.giochigratisonline.eu/giochi-sport-e-sportivi/161-gioco-calcio-europei-2008.html (il link in java è situato al termine dell'articolo a sinistra)
    Vorrei posizionare tale link in modo più visibile al centro sotto al gioco ma non so come editare il codice (in html sarebbe molto semplice)
    Oppure ancora meglio se possibile apporterei una modifica al plugin in modo da mostrare la casella con il codice html direttamente visibile.
    Qui di seguito vi riporto il codice:

    <?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( &$subject, $params )
    
        {
    
            parent::__construct( $subject, $params );
    
        }
    
    
    
        function onPrepareContent( &$article, &$params, $limitstart )
    
        {
    
            global $mainframe;
    
            
    
            $document    = & JFactory::getDocument();
    
            $view        = JRequest::getCmd('view');
    
            
    
            if ( $view != 'article' ) return;        
    
    
    
            // Get plugin info
    
            $plugin              =& JPluginHelper::getPlugin('content', 'quotethis');
    
            $pluginParams        = new JParameter( $plugin->params );
    
            $excludeSectionID    = $pluginParams->get( 'excludeSectionID',  '' );        
    
            $excludeCategoryID   = $pluginParams->get( 'excludeCategoryID', '' );
    
            $excludeID           = $pluginParams->get( 'excludeID',         '' );        
    
            $listexcludeSection  = @explode ( ",",  $excludeSectionID );    
    
            $listexcludeCategory = @explode ( ",", $excludeCategoryID );    
    
            $listexclude          = @explode ( ",",         $excludeID );        
    
            
    
            if ( $params->get( 'intro_only' ) || in_array ( $article->id, $listexclude ) || in_array ( $article->sectionid, $listexcludeSection ) || in_array ( $article->catid, $listexcludeCategory ) ) return;    
    
            
    
            JPlugin::loadLanguage( 'plg_quotethis', JPATH_ADMINISTRATOR );
    
            
    
            $loadMootools     = $pluginParams->def( 'loadMootools',           1 );
    
            $preview            = $pluginParams->def( 'preview',                1 );
    
            $txtcols         = $pluginParams->def( 'txtcols',               54 );
    
            $txtrows         = $pluginParams->def( 'txtrows',                7 );    
    
            $rowtitle        = $pluginParams->def( 'title',            'title' );        
    
            $intro           = $pluginParams->def( 'intro',                '0' );
    
            $limitcharintro  = $pluginParams->def( 'limitcharintro',     '150' );
    
            $showfirstimage  = $pluginParams->def( 'showfirstimage',       '0' );
    
            $widthimage         = $pluginParams->def( 'widthimage',         '120' );        
    
            $copyright       = $pluginParams->def( 'copyright',            '1' );
    
            $showdate        = $pluginParams->def( 'showdate',             '1' );    
    
            $width           = $pluginParams->def( 'width',                400 );
    
            $colorborder     = $pluginParams->def( 'colorborder',     '456B8F' );
    
            $backgroundcolor = $pluginParams->def( 'backgroundcolor', 'FFFFFF' );
    
            $fontsizetitle   = $pluginParams->def( 'fontsizetitle',       '13' );
    
            $colortitle      = $pluginParams->def( 'colortitle',      '003399' );
    
            $colortitlehover = $pluginParams->def( 'colortitlehover', 'FF9900' );
    
            $fontsize        = $pluginParams->def( 'fontsize',            '10' );
    
            $fontcolor       = $pluginParams->def( 'fontcolor',       '222222' );            
    
            
    
            //unset($document->_scripts[JURI::base(true) . '/media/system/js/mootools.js']);
    
            //unset($document->_scripts[JURI::base(true) . '/media/system/js/mootools-uncompressed.js']);
    
            //$document->addScript(JURI::base(true) . '/media/system/js/mootools.js');        
    
            if ( $loadMootools ) $document->addScript(JURI::base(true).'/plugins/content/quotethis/js/mootools.js');                
    
            
    
            $uri             =& JURI::getInstance();
    
            $base            = $uri->toString( array('scheme', 'host', 'port'));        
    
            $thequote        = $base.JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid));        
    
    
    
            $copyNow         = date('Y');
    
            $title           = stripslashes( $article->$rowtitle );
    
            $copyright       = ( $copyright ) ? "&copy; " . $copyNow . " - " : "" ;
    
            $thedate         = ( $showdate )  ? "<br />" . JHTML::_( 'date', $article->created, JText::_('DATE_FORMAT_LC')) : "" ;
    
            $introtext         = ( $intro )     ? "<br />" . plgContentQuotethis::prepareIntroQuoteThis( $article->text, $limitcharintro, "" ) : "" ;
    
            $image              = "";
    
            
    
            if ( $showfirstimage ) {
    
                $image = plgContentQuotethis::findIMGquotethis( $article->text );
    
                $image = "<img src=\"" . $image . "\" width=\"" . $widthimage . "\" alt=\"\" />";
    
                $image = "<div style=\"float:left;padding:5px;\">" . $image . "</div>";
    
            }
    
            
    
            $style4quote = "<style type=\"text/css\"><!--"
    
            .".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."; }"
    
            ."//--></style>";
    
    
    
            $javascript = "\n<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\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//-->"
    
                ."</script>\n";
    
                
    
            if ( $preview ) $document->addCustomTag( $style4quote );
    
                
    
            $html  = $javascript;        
    
            $html .= "<a id=\"toggle\" href=\"#\">" . JText::_('Pubblica il gioco sul tuo blog o sito') . "</a>";
    
            $html .= "<br /><div id=\"quotethisexpand\"><br />";
    
            $html .= "<strong>".JText::_('Se vuoi pubblicare un estratto di questo gioco sul tuo sito web o sul tuo sito è sufficiente che copi e incolli il codice html qui di seguito.')."</strong>";
    
            $html .= "<br /><br />";        
    
            $html .= "<textarea name=\"textarea\" cols=\"$txtcols\" rows=\"$txtrows\">".$style4quote.$image."<div class=\"quote\">"
    
            ."<a href=\"" . $thequote ."\" target=\"_blank\">" . $title . "</a>" . $thedate . $introtext
    
            ."<div align=\"right\" style=\"width:".$width."px\"><p style=\"text-align:right;\">".$copyright."<a href=\"".JURI::base()."\" target=\"_blank\">".$mainframe->getCfg('sitename')."</a></p></div></div></textarea>";
    
            $html .= "<br /><br />";
    
            
    
            if ( $preview ) {
    
                $html .= JText::_('PREVIEWQUOTE');
    
                $html .= "<br /><br />";
    
                $html .= $style4quote;
    
                $html .= $image . "<div class=\"quote\">\n<a href=\"$thequote\" target=\"_blank\">$title</a>"
    
                .$thedate.$introtext
    
                ."\n<div align=\"right\" style=\"width:".$width."px\"><p style=\"text-align:right;\">$copyright<a href=\"".JURI::base()."\" target=\"_blank\">".$mainframe->getCfg('sitename')."</a></p></div></div>";
    
                $html .= "<br />";        
    
            }
    
            $html .= "<div class=\"small\" align=\"center\">";
    
            // This software is copyrighted: don't remove the copyright notice
    
            $html .= "Powered by <a href=\"http://www.alphaplug.com\">QuoteThis</a> &copy; 2008";
    
            $html .= "</div>";
    
            $html .= "</div>";
    
                
    
            $article->text = $article->text . $html;
    
    
    
        }
    
        
    
        function prepareIntroQuoteThis( $text, $length=150, $tags='' ) {
    
            // strips tags won't remove the actual jscript
    
            $text = preg_replace( "'<script[^>]*>.*?</script>'si", "", $text );
    
            $text = preg_replace( '/{.+?}/', '', $text);
    
            // replace line breaking tags with whitespace
    
            $text = preg_replace( "'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text );
    
        
    
            return html_entity_decode(plgContentQuotethis::smartSubstrQuoteThis( strip_tags( $text, $tags ), $length ));
    
        }
    
        
    
        function smartSubstrQuoteThis($text, $length=150) {
    
            if ( strlen($text) > $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;
    
        }    
    
    }
    
    ?>
    
    1 Risposta Ultima Risposta
    Miglior risposta 0
    0
    • B
      B
      bill152
      scritto su ultima modifica di
      User Attivo 0
      #2

      Nessuno sa aiutarmi?

      1 Risposta Ultima Risposta
      Miglior risposta 0
      0

      Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

      Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

      Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

      Registrati Accedi
      Rispondi
      • Risposta alla discussione
      Effettua l'accesso per rispondere
      • Da Vecchi a Nuovi
      • Da Nuovi a Vecchi
      • Più Voti


      • Accedi

      • Non hai un account? Registrati

      • Accedi o registrati per effettuare la ricerca.
      • Primo post
        Ultimo post
      Home Accedi Registrati
      Menu
      • CATEGORIES
      • La Community Connect.gt
      • Presentati alla Community
      • News Ufficiali da Connect.gt
      • Internet News
      • A Scuola Di
      • Digital Marketing
      • Intelligenza Artificiale
      • SEO & GEO
      • Web Marketing e Content
      • Google Analytics e Web Analytics
      • Google Ads & Advertising
      • YouTube
      • TikTok, Instagram e altri Social
      • Google Adsense, Affiliazioni e Guadagno
      • E-Commerce
      • Coding e Sistemistica
      • Help Center: consigli per il tuo progetto
      • Hosting e Cloud
      • Coding
      • CMS & Piattaforme Self-Hosted
      • Annunci e Collaborazioni
      • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
      • Collaborazioni WEB e Lavoro: offro e cerco
      • Impresa, Fisco e Leggi
      • Consulenza Legale e Professioni Web
      • Consulenza Fiscale, Imprese, Startup e P.Iva
      • Gli Off Topic
      • PC, Smartphone e altri Hardware
      • Tutti i Software
      • GT Fetish Cafè
      • Discussioni
      • Non letti 0
      • Recenti
      • Hashtag
      • Popolare
      • Utenti
      • Privacy
      • Termini e condizioni
      • © 2026 Search On Media Group S.r.l.