Делаем новый хук для срабатывания плагинов в pfs.inc.php
Добавил: Amro   Дата: 07.12.2011 15:03

Итак, чтобы бесполезненно подрубать различные редакторы, включая тот же пофиксенный textboxer требуются новые хуки в pfs.inc.php. 

Первый из них позволит переопределять переменные $add_thumbnail, $add_image, $add_file: 

Итак приступим...

Хук N1

Код:
if (in_array($pfs_extension, $gd_supported) && $cfg['th_amode']!='Disabled')
    {
    if (!file_exists($cfg['th_dir_user'].$pfs_file) && file_exists($cfg['pfs_dir_user'].$pfs_file))
      {
      $th_colortext = array(hexdec(substr($cfg['th_colortext'],0,2)), hexdec(substr($cfg['th_colortext'],2,2)), hexdec(substr($cfg['th_colortext'],4,2)));
      $th_colorbg = array(hexdec(substr($cfg['th_colorbg'],0,2)), hexdec(substr($cfg['th_colorbg'],2,2)), hexdec(substr($cfg['th_colorbg'],4,2)));
      sed_createthumb($cfg['pfs_dir_user'].$pfs_file, $cfg['th_dir_user'].$pfs_file, $cfg['th_x'],$cfg['th_y'], $cfg['th_keepratio'], $pfs_extension, $pfs_file, $pfs_filesize, $th_colortext, $cfg['th_textsize'], $th_colorbg, $cfg['th_border'], $cfg['th_jpeg_quality'], $cfg['th_dimpriority']);
      }

     if ($standalone)
      {
      $icon_addimg_path = ($cfg['pfsuserfolder']) ? $userid."/".$pfs_file :  $pfs_file;
      $add_thumbnail .= "<a href=\"javascript:addthumb('".$cfg['th_dir_user'].$pfs_file."', '".$icon_addimg_path."','".$c1."','".$c2."')\"><img src=\"skins/".$skin."/img/system/icon-pastethumb.gif\" alt=\"\" /></a>";
      $add_image = "<a href=\"javascript:addpix('".$pfs_fullfile."','".$c1."','".$c2."')\"><img src=\"skins/".$skin."/img/system/icon-pasteimage.gif\" alt=\"\" /></a>";
      }
    if ($o=='thumbs')
      { $pfs_icon = "<a href=\"".$pfs_fullfile."\"><img src=\"".$cfg['th_dir_user'].$pfs_file."\" alt=\"".$pfs_file."\"></a>"; }
    }

    /* === New Hook Sed 130 === */
    $extp = sed_getextplugins('pfs.stndl.icons');
    if (is_array($extp))
      { foreach($extp as $k => $pl) { include('plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
    /* ===== */


Хук N2

было:

Код:
$pfs_header2 = "</head><body>";
$pfs_footer = "</body></html>";

$mskin = sed_skinfile(array('pfs', 'standalone'));
$t = new XTemplate($mskin);

а нужно:

Код:
$pfs_header2 = "</head><body>";
$pfs_footer = "</body></html>";

  /* === New Hook Sed 130 N2 === */
  $extp = sed_getextplugins('pfs.stndl');
  if (is_array($extp)) { foreach($extp as $k => $pl) { include('plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
/* ===== */

  $mskin = sed_skinfile(array('pfs', 'standalone'));
  $t = new XTemplate($mskin);

Хук в будущем позволит в плагинах переопределять переменные $pfs_header1, $pfs_header2, $pfs_footer

comments powered by HyperComments