پارس جوم ::  انجمن های تخصصی جوملا
مشکل در پلاگین CB Author Plug - نسخه‌ی قابل چاپ

+- پارس جوم :: انجمن های تخصصی جوملا (https://forums.parsjoom.ir)
+-- انجمن: پشتیبانی (/forum-70.html)
+--- انجمن: مباحث و مشکلات عمومی (/forum-33.html)
+--- موضوع: مشکل در پلاگین CB Author Plug (/thread-4589.html)



مشکل در پلاگین CB Author Plug - gamentech - ۲۹-۱۱-۱۳۹۰ ۰۸:۲۳ عصر

سلام
من وقتی پلاگین CB Author Plug رو نصب می کنم نمی دونم چرا در مدیریت رسانه های جوملا این ارور می یاد.
کسی می تونه بفهمه چرا این ارور می یاد
Fatal error: Call to undefined method JAdministrator::getPageParameters() in /home/gamentec/public_html/plugins/content/cbauthorplug/cbauthorplug.php on line 81
دیدن لینک ها برای شما امکان پذیر نیست. لطفا ثبت نام کنید یا وارد حساب خود شوید تا بتوانید لینک ها را ببینید.

اگه کسی کمکم کنه یک دنیا ممنون می شم.RoseRoseInlove


RE: مشکل در پلاگین CB Author Plug - Reza Ganji - ۳۰-۱۱-۱۳۹۰ ۰۲:۴۰ صبح

کدهای زیر را در فایل cbauthorplug.php کنید و تست کنید !
بک اپ از این فایل فراموش نشود !!!

کد:
<?php
/**
* @version SVN: $Id$
* @package    CBAuthorPlug
* @subpackage Base
* @author     Tony Korologos {@link http://www.tkserver.com}
* @author     Created on 10-Sept-2011  updated 11-Sept-11
*/

//-- No direct access
defined('_JEXEC') or die('=;)');


jimport( 'joomla.plugin.plugin' );

jimport( 'joomla.html.parameter' );
        

            

class plgContentCBAuthorPlug extends JPlugin
{
    

    
    function plgContentCBAuthorPlug( &$subject, $params )
    {
        parent::__construct( $subject, $params );
        
            
    }
    
             
    function onPrepareContent( &$article, &$params, $limitstart )
    
    {
    
    }
    
    
function onAfterDisplayTitle( &$article, &$params, $limitstart )
    {
            //$plugin = & JPluginHelper::getPlugin('content', 'cbauthorplug');
            //$pluginParams   = new JParameter( $plugin->params );
            
            //$disablejauthor = $this->params->def('disablejauthor');
            $disablejauthor = $this->params->def('disablejauthor');
            
            
            $exclude_authors = explode(',',$exclude_authors1);
            foreach ($exclude_authors as $id) {
                if ($row->created_by == (int)trim($id)) {
                    return;
                }
            }
            
            
            $exclude_cats = explode(',',$exclude_cats1);
            foreach ($exclude_cats as $id) {
                if ($row->catid == (int)trim($id)) {
                    return;
                }
            }    
                            if ($disablejauthor == "yes" ) {
                            $article->author = "";
                                        
                            }

    }
    
    
public function onContentBeforeDisplay($context, &$row, &$params, $page=0)
    {

        // fix j1.6 media manager bug
        $curoption = JRequest::getVar('option');
        if ($curoption != "com_media"){
        
        $app = JFactory::getApplication();
        $parameter = new JParameter($row->attribs);
        
        $displayposition = $this->params->def('displayposition');
        $mainframe = JFactory::getApplication();
            
        $global_page_show_author = $mainframe->getPageParameters()->get('show_author');
        $article_show_author = $parameter->get('show_author',null);    

    
        if     ($displayposition == 'After'){ return; }

            $exclude_authors1 = $this->params->def('exclude_authors');
            $exclude_cats1 = $this->params->def('exclude_cats');
            $showfrontpage = $this->params->def('showfrontpage');
            $showavatar = $this->params->def('showavatar');
            $avatarwidth = $this->params->def('avatarwidth');
            $avatarmarginleft = $this->params->def('avatarmarginleft');
            $avatarmarginright = $this->params->def('avatarmarginright');
            $avatarfloat = $this->params->def('avatarfloat');
            $introtext = $this->params->def('introtext', '');
            $outrotext = $this->params->def('outrotext', '');
            $showname = $this->params->def('showname', 'name');
            $textfloat = $this->params->def('textfloat');
            $fontsize = $this->params->def('fontsize');
            $textcolor = $this->params->def('textcolor');
            $linkcolor = $this->params->def('linkcolor');
            $disablejauthor = $this->params->def('disablejauthor');
            
                    $exclude_authors = explode(',',$exclude_authors1);
                    foreach ($exclude_authors as $id) {
                        if ($row->created_by == (int)trim($id)) {
                            return;
                        }
                    }
                    
                    
                    $exclude_cats = explode(',',$exclude_cats1);
                    foreach ($exclude_cats as $id) {
                        if ($row->catid == (int)trim($id)) {
                            return;
                        }
                    }        
    
    if ($disablejauthor == "no" ) {
            
            
            $database = &JFactory::getDbo();
            $uri = & JFactory::getURI();
            $sql = "SELECT $showname from #__users where id = '$row->created_by' LIMIT 1";
            $database->setQuery($sql);
            $cbname = $database->loadResult();
            $sql2 = "SELECT avatar FROM #__comprofiler WHERE user_id = '$row->created_by' AND avatarapproved = 1 LIMIT 1";
            $database->setQuery($sql2);
            $avatar = $database->loadResult();    
            $sql4 = "SELECT * FROM #__content_frontpage WHERE content_id = '$row->id' LIMIT 1";
            $database->setQuery($sql4);
            $onfrontpage = $database->loadResult();        
            
            $tn = 'tn';
        
        if(($showfrontpage == 'no') && ($onfrontpage)) { return; }
                
        if($showavatar == 0) {$avatar = '';}
        if(strstr($avatar,'gallery'))
            {
            $tn = '';
            }
    
        $createdbyauthor     = $row->created_by_alias;
        $createdby_id = $row->created_by;
        
        return '<!-- CSS STYLES -->

                <style type="text/css">
                <!--

                div.idcbauthorplug {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $textcolor . ';
                float: ' . $textfloat . ';
                
                }
                
                div.idcbauthorplug a {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $linkcolor . ';
                
                }
            
                div.cbauthorplug img {
                border-style: none;
                width: ' . $avatarwidth . 'px;
                margin-right: ' . $avatarmarginright . 'px;
                margin-left: ' . $avatarmarginleft . 'px;
                float: ' . $avatarfloat . ';
            }
            
            --></style>'
            . '<div class="cbauthorplug"><a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id
            . '"><img src="images/comprofiler/' . $tn . $avatar . '"></a><div class="idcbauthorplug">' . $introtext
            . '<a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id . '"> '. $cbname . '</a> ' . $outrotext . '</div></div>';
            
             }
            
             // end if $disablejauthor no
            
    if ($disablejauthor == "yes" ) {
        

        if($article_show_author == "1") {$showcbap = 'yes';}        
        if($article_show_author == "0") {$showcbap = 'no';}
        if($global_page_show_author == "1" && $article_show_author == NULL){$showcbap = 'yes';}
        if($global_page_show_author == "0" && $article_show_author == NULL){$showcbap = 'no';}
                
        if($showcbap == 'yes'){
        $database = &JFactory::getDbo();
        $uri = & JFactory::getURI();
        $sql = "SELECT $showname from #__users where id = '$row->created_by' LIMIT 1";
        $database->setQuery($sql);
        $cbname = $database->loadResult();
        $sql2 = "SELECT avatar FROM #__comprofiler WHERE user_id = '$row->created_by' AND avatarapproved = 1 LIMIT 1";
        $database->setQuery($sql2);
        $avatar = $database->loadResult();    
        $sql3 = "SELECT state FROM #__content WHERE id = '$row->id' LIMIT 1";
        $database->setQuery($sql3);
        $pubstate = $database->loadResult();
        $sql4 = "SELECT * FROM #__content_frontpage WHERE content_id = '$row->id' LIMIT 1";
        $database->setQuery($sql4);
        $onfrontpage = $database->loadResult();    
            
        $tn = 'tn';
                
        if(($showfrontpage == 'no') && ($onfrontpage)) {
        
        return; }
        
                                
        if($showavatar == 0) {$avatar = '';}
        if(strstr($avatar,'gallery'))
            {
            $tn = '';
            }
    
        $createdbyauthor     = $row->created_by_alias;
        $createdby_id = $row->created_by;
        
        return '<!-- CSS STYLES -->

                <style type="text/css">
                <!--

                dd.createdby {display: none;}
                
                div.idcbauthorplug {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $textcolor . ';
                float: ' . $textfloat . ';
                
                }
                
                div.idcbauthorplug a {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $linkcolor . ';
                
                }
            
                div.cbauthorplug img {
                border-style: none;
                width: ' . $avatarwidth . 'px;
                margin-right: ' . $avatarmarginright . 'px;
                margin-left: ' . $avatarmarginleft . 'px;
                float: ' . $avatarfloat . ';
            }
            
            --></style>'
            . '<div class="cbauthorplug"><a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id
            . '"><img src="images/comprofiler/' . $tn . $avatar . '"></a><div class="idcbauthorplug">' . $introtext
            . '<a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id . '"> '. $cbname . '</a> ' . $outrotext
            .  '</div></div>';
            }
       }
      
       }  // end if curoption
    }  
  
public function onContentAfterDisplay($context, &$row, &$params, $page=0) {

        // fix j1.6 media manager bug
            $curoption = JRequest::getVar('option');
            if ($curoption != "com_media"){

            $app = JFactory::getApplication();
            $parameter = new JParameter($row->attribs);
            
            $displayposition = $this->params->def('displayposition');
            $mainframe = JFactory::getApplication();
                
            $global_page_show_author = $mainframe->getPageParameters()->get('show_author');
            $article_show_author = $parameter->get('show_author',null);    

            
            //$plugin = & JPluginHelper::getPlugin('content', 'cbauthorplug');
            //$pluginParams   = new JParameter( $plugin->params );
            $displayposition = $this->params->def('displayposition');
        
            if     ($displayposition == 'Before'){ return; }

            $exclude_authors1 = $this->params->def('exclude_authors');
            $exclude_cats1 = $this->params->def('exclude_cats');
            $showfrontpage = $this->params->def('showfrontpage');
            $showavatar = $this->params->def('showavatar');
            $avatarwidth = $this->params->def('avatarwidth');
            $avatarmarginleft = $this->params->def('avatarmarginleft');
            $avatarmarginright = $this->params->def('avatarmarginright');
            $avatarfloat = $this->params->def('avatarfloat');
            $introtext = $this->params->def('introtext', '');
            $outrotext = $this->params->def('outrotext', '');
            $showname = $this->params->def('showname', 'name');
            $textfloat = $this->params->def('textfloat');
            $fontsize = $this->params->def('fontsize');
            $textcolor = $this->params->def('textcolor');
            $linkcolor = $this->params->def('linkcolor');
            $disablejauthor = $this->params->def('disablejauthor');
            
            
            $exclude_authors = explode(',',$exclude_authors1);
            foreach ($exclude_authors as $id) {
                if ($row->created_by == (int)trim($id)) {
                    return;
                }
            }
            
            
            $exclude_cats = explode(',',$exclude_cats1);
            foreach ($exclude_cats as $id) {
                if ($row->catid == (int)trim($id)) {
                    return;
                }
            }    
    
            if ($disablejauthor == "no" ) {
            
        $database = &JFactory::getDbo();
        $uri = & JFactory::getURI();
        $sql = "SELECT $showname from #__users where id = '$row->created_by' LIMIT 1";
        $database->setQuery($sql);
        $cbname = $database->loadResult();
        $sql2 = "SELECT avatar FROM #__comprofiler WHERE user_id = '$row->created_by' AND avatarapproved = 1 LIMIT 1";
        $database->setQuery($sql2);
        $avatar = $database->loadResult();    
        $sql4 = "SELECT * FROM #__content_frontpage WHERE content_id = '$row->id' LIMIT 1";
        $database->setQuery($sql4);
        $onfrontpage = $database->loadResult();        
        
        $tn = 'tn';
        
        if(($showfrontpage == 'no') && ($onfrontpage)) { return; }
                
        if($showavatar == 0) {$avatar = '';}
        if(strstr($avatar,'gallery'))
            {
            $tn = '';
            }
    
        $createdbyauthor     = $row->created_by_alias;
        $createdby_id = $row->created_by;
        
        return '<!-- CSS STYLES -->

                <style type="text/css">
                <!--

                div.idcbauthorplug {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $textcolor . ';
                float: ' . $textfloat . ';
                
                }
                
                div.idcbauthorplug a {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $linkcolor . ';
                
                }
            
                div.cbauthorplug img {
                border-style: none;
                width: ' . $avatarwidth . 'px;
                margin-right: ' . $avatarmarginright . 'px;
                margin-left: ' . $avatarmarginleft . 'px;
                float: ' . $avatarfloat . ';
            }
            
            --></style>'
            . '<div class="cbauthorplug"><a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id
            . '"><img src="images/comprofiler/' . $tn . $avatar . '"></a><div class="idcbauthorplug">' . $introtext
            . '<a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id . '"> '. $cbname . '</a> ' . $outrotext . '</div></div>';
            
             }
            
             // end if $disablejauthor no
            
    if ($disablejauthor == "yes" ) {
        

        if($article_show_author == "1") {$showcbap = 'yes';}        
        if($article_show_author == "0") {$showcbap = 'no';}
        if($global_page_show_author == "1" && $article_show_author == NULL){$showcbap = 'yes';}
        if($global_page_show_author == "0" && $article_show_author == NULL){$showcbap = 'no';}
                
        if($showcbap == 'yes'){
        $database = &JFactory::getDbo();
        $uri = & JFactory::getURI();
        $sql = "SELECT $showname from #__users where id = '$row->created_by' LIMIT 1";
        $database->setQuery($sql);
        $cbname = $database->loadResult();
        $sql2 = "SELECT avatar FROM #__comprofiler WHERE user_id = '$row->created_by' AND avatarapproved = 1 LIMIT 1";
        $database->setQuery($sql2);
        $avatar = $database->loadResult();    
        $sql3 = "SELECT state FROM #__content WHERE id = '$row->id' LIMIT 1";
        $database->setQuery($sql3);
        $pubstate = $database->loadResult();
        $sql4 = "SELECT * FROM #__content_frontpage WHERE content_id = '$row->id' LIMIT 1";
        $database->setQuery($sql4);
        $onfrontpage = $database->loadResult();    
            
        $tn = 'tn';
                
        if(($showfrontpage == 'no') && ($onfrontpage)) {
        
        return; }
        
                                
        if($showavatar == 0) {$avatar = '';}
        if(strstr($avatar,'gallery'))
            {
            $tn = '';
            }
    
        $createdbyauthor     = $row->created_by_alias;
        $createdby_id = $row->created_by;
        
        return '<!-- CSS STYLES -->

                <style type="text/css">
                <!--

                dd.createdby {display: none;}
                
                div.idcbauthorplug {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $textcolor . ';
                float: ' . $textfloat . ';
                
                }
                
                div.idcbauthorplug a {'. '
                font-size: ' . $fontsize . 'px;
                color: ' . $linkcolor . ';
                
                }
            
                div.cbauthorplug img {
                border-style: none;
                width: ' . $avatarwidth . 'px;
                margin-right: ' . $avatarmarginright . 'px;
                margin-left: ' . $avatarmarginleft . 'px;
                float: ' . $avatarfloat . ';
            }
            
            --></style>'
            . '<div class="cbauthorplug"><a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id
            . '"><img src="images/comprofiler/' . $tn . $avatar . '"></a><div class="idcbauthorplug">' . $introtext
            . '<a href="index.php?option=com_comprofiler&task=userProfile&user=' . $createdby_id . '"> '. $cbname . '</a> ' . $outrotext
            .  '</div></div>';
            }
       }
       } // end J1.6 media manager bug
}  

    


}//class



RE: مشکل در پلاگین CB Author Plug - gamentech - ۳۰-۱۱-۱۳۹۰ ۱۰:۰۱ عصر

منظورتون این هست که کل متن تو cbauthorplug.php رو پاک کنم و متن بالا رو جایرگزین کنم؟
اقا رضا درست شد.
ممنون.RoseRoseRoseRoseInloveInlove


RE: مشکل در پلاگین CB Author Plug - gamentech - ۳-۱۲-۱۳۹۰ ۰۳:۴۵ صبح

مشکل من تو مدیریت رسانه ها حل شد.
اما تو صفحه اول کنترل پنل منو ها در هم برهم شدند.
راهی نسیت که هم مشکل مدیریت رسانه ها حل بشه و هم کنترل پنل در هم برهم نشه.
[تصویر:  13482025260312030701.jpg]


RE: مشکل در پلاگین CB Author Plug - Reza Ganji - ۳-۱۲-۱۳۹۰ ۰۴:۳۴ صبح

این مشکل فکر میکنم با ویرایش سی اس اس حل بشه !
ممکن است دوستانی که سی اس اس بلد هستند به شما کمک کنند ولی فکر میکنم باید به مدیریت دسترسی داشته باشند !


RE: مشکل در پلاگین CB Author Plug - gamentech - ۳-۱۲-۱۳۹۰ ۰۷:۳۷ عصر

حالا اگه این طوری باشه مشکلی که برای خود سایت پیش نمی یاد که؟Rose


RE: مشکل در پلاگین CB Author Plug - ehsansabet - ۳-۱۲-۱۳۹۰ ۰۸:۱۲ عصر

(۳-۱۲-۱۳۹۰ ۰۷:۳۷ عصر)gamentech نوشته شده توسط: دیدن لینک ها برای شما امکان پذیر نیست. لطفا ثبت نام کنید یا وارد حساب خود شوید تا بتوانید لینک ها را ببینید.
حالا اگه این طوری باشه مشکلی که برای خود سایت پیش نمی یاد که؟Rose

نه مشکلی پیش نمیاد . این مشکل فقط در قسمت مدیریته.

اگرم هم مایل بودی یه دسترسی موقت بده تا یه نیگاهی بندازم و درستش کنم.