Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/11/2015, 08:47
leoncito34
 
Fecha de Ingreso: junio-2008
Mensajes: 82
Antigüedad: 15 años, 10 meses
Puntos: 2
Modificar codigo php para cargar una imagen

hola gente ... necesito integrar un codigo de facebook en php para que me carge la imagen correcta, porque hasta ahora me carga otra imagen que no corresponde..

le mande un mensaje via facebook (.sic) a la gente de Addthis porque tengo su componente instalado y me sigue sucediendo lo mismo.. ellos me indican que tengo que agregar el siguiente codigo para que carge la imagen correcta

Código HTML:
Ver original
  1. <meta property="og:image" content="http://i2.ytimg.com/vi/1F7DKyFt5pY/default.jpg" />

necesito solucionar este problema .. no manejo php aunque me gustaria la verdad.. me gustaría que algún experto me ayude a integrar este código al que dejo mas abajo para que me cargue correctamente la imagen que necesito para compartir en facebook ..saludos coordiales

Código PHP:
Ver original
  1. defined('JPATH_BASE') or die;
  2.  
  3. $print = $displayData['print'];
  4. $item = $displayData['item'];
  5. $params = $item->params;
  6. $positions = $params->get('block_position', 0);
  7.  
  8. $useDefList =
  9.     ($params->get('show_modify_date') ||
  10.         $params->get('show_publish_date') ||
  11.         $params->get('show_create_date') ||
  12.         $params->get('show_hits') ||
  13.         $params->get('show_category') ||
  14.         $params->get('show_parent_category') ||
  15.         $params->get('show_author'));
  16. $icons = $params->get('show_print_icon') || $params->get('show_email_icon');
  17.  
  18. $tplparams = JFactory::getApplication()->getTemplate(true)->params;
  19. $typo_tools = $params->get('show_typo_tools', '') == '' ? $tplparams->get('show_typo_tools', 1) : $params->get('show_typo_tools');
  20. $sharing_tools = $params->get('show_sharing_tools', '') == '' ? $tplparams->get('show_sharing_tools', 1) : $params->get('show_sharing_tools');
  21. $tools = $icons || $typo_tools || $sharing_tools;
  22. ?>
  23. <article class="article" itemscope itemtype="http://schema.org/Article">
  24.     <meta itemprop="inLanguage" content="<?php echo ($item->language === '*') ? JFactory::getConfig()->get('language') : $item->language; ?>" />
  25.     <meta itemprop="url" content="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid)) ?>" />
  26.     <?php if ($params->get('show_title')) : ?>
  27.         <?php echo JLayoutHelper::render('joomla.content.item_title', array('item' => $item, 'params' => $params, 'title-tag'=>'h1')); ?>
  28.     <?php endif; ?>
  29.     <?php if ($print || ($useDefList && in_array($positions, array(0, 2)))) : ?>
  30.         <aside class="article-aside article-aside-full">
  31.             <?php if ($useDefList && in_array($positions, array(0, 2))) : ?>
  32.             <?php echo JLayoutHelper::render('joomla.content.info_block.magazine_block', array('item' => $item, 'params' => $params, 'position' => 'above')); ?>
  33.             <?php endif ?>
  34.  
  35.             <?php if ($print): ?>
  36.                 <div id="pop-print" class="hidden-print">
  37.                     <?php echo JHtml::_('icon.print_screen', $item, $params); ?>
  38.                 </div>
  39.             <?php endif ?>
  40.         </aside>
  41.     <?php endif; ?>
  42.  
  43.     <section class="article-intro-media">
  44.         <?php echo JLayoutHelper::render('joomla.content.image.intro', $displayData); ?>
  45.         <?php $title = $item->category_title; ?>
  46.  
  47.         <?php if ($params->get('show_category')) : ?>
  48.             <?php echo JLayoutHelper::render('joomla.content.info_block.magazine_category', array('item' => $item, 'params' => $params)); ?>
  49.         <?php endif; ?>
  50.     </section>
  51.  
  52.     <section class="row article-navigation top">
  53.         <?php if (isset ($item->pagination)) echo $item->pagination ?>
  54.     </section>
  55.  
  56.     <section class="article-full<?php if($tools) :?> has-article-tools<?php endif ?>">
  57.  
  58.         <?php if ($tools): ?>
  59.     <div class="article-tools">
  60.  
  61.             <?php if ($icons): ?>
  62.         <div class="default-tools">
  63.             <h6><?php echo JText::_('TPL_DEFAULT_TOOL_TITLE') ?></h6>
  64.         <?php echo JLayoutHelper::render('joomla.content.magazine_icons', array('item' => $item, 'params' => $params)); ?>
  65.       </div>
  66.             <?php endif; ?>
  67.  
  68.             <?php if ($typo_tools): ?>
  69.             <?php echo JLayoutHelper::render('joomla.content.typo_tools', array()); ?>
  70.             <?php endif ?>
  71.  
  72.             <?php if ($sharing_tools): ?>
  73.             <?php echo JLayoutHelper::render('joomla.content.sharing_tools', array()); ?>
  74.             <?php endif ?>
  75.     </div>
  76.         <?php endif ?>
  77.  
  78.         <div class="article-content-main">
  79.  
  80.         <?php if (!$params->get('show_intro', 1)) : ?>
  81.             <?php echo $item->event->afterDisplayTitle; ?>
  82.         <?php endif; ?>
  83.         <?php echo $item->event->beforeDisplayContent; ?>
  84.  
  85.         <?php if ($params->get('show_intro', 0)) : ?>
  86.             <blockquote class="article-intro">
  87.                 <?php echo $item->introtext; ?>
  88.             </blockquote>
  89.         <?php endif; ?>
  90.  
  91.             <section class="article-content">
  92.                 <?php echo JLayoutHelper::render('joomla.content.info_block.topic', array('item' => $item)); ?>
  93.                 <?php echo $item->text; ?>
  94.                
  95.                 <?php if ($params->get('show_tags', 1) && !empty($item->tags)) : ?>
  96.                     <?php echo JLayoutHelper::render('joomla.content.tags', $item->tags->itemTags); ?>
  97.                 <?php endif; ?>
  98.             </section>
  99.  
  100.         <?php if ($useDefList && in_array($positions, array(1, 2))) : ?>
  101.             <footer class="article-footer">
  102.                 <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $item, 'params' => $params, 'position' => 'below')); ?>
  103.             </footer>
  104.         <?php endif; ?>
  105.        
  106.  
  107.         <?php if ($params->get('show_readmore') && $item->readmore) :
  108.             if ($item->params->get('access-view')) :
  109.                 $link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid));
  110.             else :
  111.                 $menu = JFactory::getApplication()->getMenu();
  112.                 $active = $menu->getActive();
  113.                 $itemId = $active->id;
  114.                 $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
  115.                 $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid));
  116.                 $link = new JUri($link1);
  117.                 $link->setVar('return', base64_encode($returnURL));
  118.             endif; ?>
  119.  
  120.             <div class="readmore">
  121.                 <a class="btn btn-default" href="<?php echo $link; ?>"><span>
  122.                     <?php if (!$item->params->get('access-view')) :
  123.                         echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
  124.                     elseif ($readmore = $item->alternative_readmore) :
  125.                         echo $readmore;
  126.                         if ($params->get('show_readmore_title', 0) != 0) :
  127.                             echo JHtml::_('string.truncate', ($item->title), $params->get('readmore_limit'));
  128.                         endif;
  129.                     elseif ($params->get('show_readmore_title', 0) == 0) :
  130.                         echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
  131.                     else :
  132.                         echo JText::_('COM_CONTENT_READ_MORE');
  133.                         echo JHtml::_('string.truncate', ($item->title), $params->get('readmore_limit'));
  134.                     endif; ?>
  135.                 </span></a>
  136.             </div>
  137.  
  138.         <?php endif; ?>
  139.  
  140.         <?php echo $item->event->afterDisplayContent; ?>
  141.  
  142.         </div>
  143.     </section>
  144.  
  145.     <section class="row article-navigation bottom">
  146.         <?php if (isset ($item->pagination)) echo $item->pagination ?>
  147.     </section>
  148.  
  149. </article>