[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/content/ -> content_shortcodes.php (source)

   1  <?php
   2  if (!defined('e107_INIT')) { exit; }
   3  include_once(e_HANDLER.'shortcode_handler.php');
   4  $content_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
   5  /*
   6  
   7  SC_BEGIN CONTENT_NEXTPREV
   8  global $CONTENT_NEXTPREV;
   9  return $CONTENT_NEXTPREV;
  10  SC_END
  11  
  12  // CONTENT_TYPE_TABLE ------------------------------------------------
  13  SC_BEGIN CONTENT_TYPE_TABLE_TOTAL
  14  global $contenttotal;
  15  return $contenttotal." ".($contenttotal == 1 ? CONTENT_LAN_53 : CONTENT_LAN_54);
  16  SC_END
  17  
  18  SC_BEGIN CONTENT_TYPE_TABLE_HEADING
  19  global $CONTENT_TYPE_TABLE_HEADING, $contenttotal, $row, $tp;
  20  $row['content_heading'] = $tp -> toHTML($row['content_heading'], TRUE, "emotes_off, no_make_clickable");
  21  return ($contenttotal != "0" ? "<a href='".e_SELF."?cat.".$row['content_id']."'>".$row['content_heading']."</a>" : $row['content_heading'] );
  22  SC_END
  23  
  24  SC_BEGIN CONTENT_TYPE_TABLE_LINK
  25  global $row, $tp;
  26  $text = "
  27  [<a href='".e_PLUGIN."content/content.php?cat.list.".$row['content_id']."'>".CONTENT_TYPE_LAN_0."</a>] 
  28  [<a href='".e_PLUGIN."content/content.php?author.list.".$row['content_id']."'>".CONTENT_TYPE_LAN_1."</a>] 
  29  [<a href='".e_PLUGIN."content/content.php?list.".$row['content_id']."'>".CONTENT_TYPE_LAN_2."</a>] 
  30  [<a href='".e_PLUGIN."content/content.php?top.".$row['content_id']."'>".CONTENT_TYPE_LAN_3."</a>] 
  31  [<a href='".e_PLUGIN."content/content.php?score.".$row['content_id']."'>".CONTENT_TYPE_LAN_4."</a>] 
  32  [<a href='".e_PLUGIN."content/content.php?recent.".$row['content_id']."'>".CONTENT_TYPE_LAN_5."</a>]";
  33  return $text;
  34  SC_END
  35  
  36  
  37  SC_BEGIN CONTENT_TYPE_TABLE_SUBHEADING
  38  global $CONTENT_TYPE_TABLE_SUBHEADING, $contenttotal, $row, $tp;
  39  $row['content_subheading'] = $tp -> toHTML($row['content_subheading'], TRUE, "emotes_off, no_make_clickable");
  40  return ($row['content_subheading'] ? $row['content_subheading'] : "");
  41  SC_END
  42  
  43  SC_BEGIN CONTENT_TYPE_TABLE_ICON
  44  global $CONTENT_TYPE_TABLE_ICON, $contenttotal, $row, $aa, $content_cat_icon_path_large, $content_pref;
  45  if($contenttotal != "0"){
  46      $CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]);
  47  }else{
  48      $CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]);
  49  }
  50  return $CONTENT_TYPE_TABLE_ICON;
  51  SC_END
  52  
  53  // CONTENT_TYPE_TABLE_SUBMIT ------------------------------------------------
  54  SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_ICON
  55  global $CONTENT_TYPE_TABLE_SUBMIT_ICON, $plugindir;
  56  return "<a href='".$plugindir."content_submit.php'>".CONTENT_ICON_SUBMIT."</a>";
  57  SC_END
  58  
  59  SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_HEADING
  60  global $CONTENT_TYPE_TABLE_SUBMIT_HEADING, $plugindir;
  61  return "<a href='".$plugindir."content_submit.php'>".CONTENT_LAN_65."</a>";
  62  SC_END
  63  
  64  SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING
  65  global $CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING;
  66  return CONTENT_LAN_66;
  67  SC_END
  68  
  69  // CONTENT_TYPE_TABLE_MANAGER ------------------------------------------------
  70  SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_ICON
  71  global $CONTENT_TYPE_TABLE_MANAGER_ICON, $plugindir;
  72  return "<a href='".$plugindir."content_manager.php'>".CONTENT_ICON_CONTENTMANAGER."</a>";
  73  SC_END
  74  
  75  SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_HEADING
  76  global $CONTENT_TYPE_TABLE_MANAGER_HEADING, $plugindir;
  77  return "<a href='".$plugindir."content_manager.php'>".CONTENT_LAN_67."</a>";
  78  SC_END
  79  
  80  SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_SUBHEADING
  81  global $CONTENT_TYPE_TABLE_MANAGER_SUBHEADING;
  82  return CONTENT_LAN_68;
  83  SC_END
  84  
  85  // CONTENT_TOP_TABLE ------------------------------------------------
  86  SC_BEGIN CONTENT_TOP_TABLE_HEADING
  87  global $CONTENT_TOP_TABLE_HEADING, $row, $qs;
  88  return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
  89  SC_END
  90  
  91  SC_BEGIN CONTENT_TOP_TABLE_ICON
  92  global $CONTENT_TOP_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent;
  93  if($content_pref["content_top_icon"]){
  94  $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100");
  95  $width = (isset($content_pref["content_top_icon_width"]) && $content_pref["content_top_icon_width"] ? $content_pref["content_top_icon_width"] : $width);
  96  return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]);
  97  }
  98  SC_END
  99  
 100  SC_BEGIN CONTENT_TOP_TABLE_AUTHOR
 101  global $CONTENT_TOP_TABLE_AUTHOR;
 102  return $CONTENT_TOP_TABLE_AUTHOR;
 103  SC_END
 104  
 105  SC_BEGIN CONTENT_TOP_TABLE_RATING
 106  global $CONTENT_TOP_TABLE_RATING, $row;
 107  $row['rate_avg'] = round($row['rate_avg'], 1);
 108  $row['rate_avg'] = (strlen($row['rate_avg'])>1 ? $row['rate_avg'] : $row['rate_avg'].".0");
 109  $tmp = explode(".", $row['rate_avg']);
 110  $rating = "";
 111  $rating .= $row['rate_avg']." ";
 112  for($c=1; $c<= $tmp[0]; $c++){
 113      $rating .= "<img src='".e_IMAGE."rate/box.png' alt='' style='border:0; height:8px; vertical-align:middle' />";
 114  }
 115  if($tmp[0] < 10){
 116      for($c=9; $c>=$tmp[0]; $c--){
 117          $rating .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='border:0; height:8px; vertical-align:middle' />";
 118      }
 119  }
 120  $rating .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='border:0; height:8px; vertical-align:middle' />";
 121  return $rating;
 122  SC_END
 123  
 124  // CONTENT_SCORE_TABLE ------------------------------------------------
 125  SC_BEGIN CONTENT_SCORE_TABLE_HEADING
 126  global $CONTENT_SCORE_TABLE_HEADING, $row, $qs;
 127  return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
 128  SC_END
 129  
 130  SC_BEGIN CONTENT_SCORE_TABLE_ICON
 131  global $CONTENT_SCORE_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent;
 132  if(isset($content_pref["content_score_icon"]) && $content_pref["content_score_icon"]){
 133  $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100");
 134  $width = (isset($content_pref["content_score_icon_width"]) && $content_pref["content_score_icon_width"] ? $content_pref["content_score_icon_width"] : $width);
 135  return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]);
 136  }
 137  SC_END
 138  
 139  SC_BEGIN CONTENT_SCORE_TABLE_AUTHOR
 140  global $CONTENT_SCORE_TABLE_AUTHOR;
 141  return $CONTENT_SCORE_TABLE_AUTHOR;
 142  SC_END
 143  
 144  SC_BEGIN CONTENT_SCORE_TABLE_SCORE
 145  global $CONTENT_SCORE_TABLE_SCORE, $row;
 146  $score = $row['content_score'];
 147  $height = "height:8px;";
 148  $img = "";
 149  $img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
 150  $img .= "<img src='".e_PLUGIN."content/images/score.png' alt='' style='$height width:".$score."px; border:0;' />";
 151  $img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
 152  if($score < 100){
 153      $empty = 100-$score;
 154      $img .= "<img src='".e_PLUGIN."content/images/score_empty.png' alt='' style='$height width:".$empty."px; border:0;' />";
 155  }
 156  $img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
 157  return $score."/100 ".$img;
 158  SC_END
 159  
 160  // CONTENT_SUBMIT_TYPE_TABLE ------------------------------------------------
 161  SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_HEADING
 162  global $CONTENT_SUBMIT_TYPE_TABLE_HEADING, $row;
 163  return "<a href='".e_SELF."?content.submit.".$row['content_id']."'>".$row['content_heading']."</a>";
 164  SC_END
 165  
 166  SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING
 167  global $CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING, $row;
 168  return ($row['content_subheading'] ? $row['content_subheading'] : "");
 169  SC_END
 170  
 171  SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_ICON
 172  global $CONTENT_SUBMIT_TYPE_TABLE_ICON, $aa, $row, $content_cat_icon_path_large, $content_pref;
 173  return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "content.submit.".$row['content_id'], "", $content_pref["content_blank_caticon"]);
 174  SC_END
 175  
 176  // CONTENT_CONTENT_TABLEMANAGER ------------------------------------------------
 177  SC_BEGIN CONTENT_CONTENTMANAGER_CATEGORY
 178  global $CONTENT_CONTENTMANAGER_CATEGORY, $row, $content_pref;
 179  if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) || (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) ){
 180  return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
 181  }
 182  SC_END
 183  
 184  SC_BEGIN CONTENT_CONTENTMANAGER_ICONNEW
 185  global $CONTENT_CONTENTMANAGER_ICONNEW, $row, $content_pref;
 186  if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){
 187  return "<a href='".e_SELF."?content.create.".$row['content_id']."'>".CONTENT_ICON_NEW."</a>";
 188  //return "<input type='button' onclick=\"document.location='".e_SELF."?content.create.".$row['content_id']."'\" value='new' title='new' />";
 189  }
 190  SC_END
 191  
 192  SC_BEGIN CONTENT_CONTENTMANAGER_ICONEDIT
 193  global $CONTENT_CONTENTMANAGER_ICONEDIT, $row, $content_pref;
 194  if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){
 195  return "<a href='".e_SELF."?content.".$row['content_id']."'>".CONTENT_ICON_EDIT."</a>";
 196  //return "<input type='button' onclick=\"document.location='".e_SELF."?content.".$row['content_id']."'\" value='edit' title='edit' />";
 197  }
 198  SC_END
 199  
 200  SC_BEGIN CONTENT_CONTENTMANAGER_ICONSUBM
 201  global $CONTENT_CONTENTMANAGER_ICONSUBM, $row, $content_pref, $plugintable;
 202  if(isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])){
 203      if(!is_object($sqls)){ $sqls = new db; }
 204      $num = $sqls -> db_Count($plugintable, "(*)", "WHERE content_refer = 'sa' AND content_parent='".intval($row['content_id'])."' ");
 205      if($num>0){
 206          return "<a href='".e_SELF."?content.submitted.".$row['content_id']."'>".CONTENT_ICON_SUBMIT_SMALL."</a>";
 207      }
 208  }
 209  SC_END
 210  
 211  
 212  // CONTENT_AUTHOR_TABLE ------------------------------------------------
 213  SC_BEGIN CONTENT_AUTHOR_TABLE_NAME
 214  global $CONTENT_AUTHOR_TABLE_NAME, $authordetails, $i, $qs, $row;
 215  $name = ($authordetails[$i][1] == "" ? "... ".CONTENT_LAN_29." ..." : $authordetails[$i][1]);
 216  $authorlink = "<a href='".e_SELF."?author.".$row['content_id']."'>".$name."</a>";
 217  return $authorlink;
 218  SC_END
 219  
 220  SC_BEGIN CONTENT_AUTHOR_TABLE_ICON
 221  global $CONTENT_AUTHOR_TABLE_ICON, $qs, $row;
 222  return "<a href='".e_SELF."?author.".$row['content_id']."'>".CONTENT_ICON_AUTHORLIST."</a>";
 223  SC_END
 224  
 225  SC_BEGIN CONTENT_AUTHOR_TABLE_TOTAL
 226  global $CONTENT_AUTHOR_TABLE_TOTAL, $totalcontent, $mainparent, $content_pref;
 227  if($content_pref["content_author_amount"]){
 228  $CONTENT_AUTHOR_TABLE_TOTAL = $totalcontent." ".($totalcontent==1 ? CONTENT_LAN_53 : CONTENT_LAN_54);
 229  return $CONTENT_AUTHOR_TABLE_TOTAL;
 230  }
 231  SC_END
 232  
 233  SC_BEGIN CONTENT_AUTHOR_TABLE_LASTITEM
 234  global $CONTENT_AUTHOR_TABLE_LASTITEM, $gen, $row, $mainparent, $content_pref;
 235  if($content_pref["content_author_lastitem"]){
 236  if(!is_object($gen)){ $gen = new convert; }
 237  $CONTENT_AUTHOR_TABLE_LASTITEM = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short"));
 238  $CONTENT_AUTHOR_TABLE_LASTITEM .= " : <a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
 239  return $CONTENT_AUTHOR_TABLE_LASTITEM;
 240  }
 241  SC_END
 242  
 243  // CONTENT_CAT_TABLE ------------------------------------------------
 244  SC_BEGIN CONTENT_CAT_TABLE_INFO_PRE
 245  global $CONTENT_CAT_TABLE_INFO_PRE;
 246  if($CONTENT_CAT_TABLE_INFO_PRE === TRUE){
 247  $CONTENT_CAT_TABLE_INFO_PRE = " ";
 248  return $CONTENT_CAT_TABLE_INFO_PRE;
 249  }
 250  SC_END
 251  SC_BEGIN CONTENT_CAT_TABLE_INFO_POST
 252  global $CONTENT_CAT_TABLE_INFO_POST;
 253  if($CONTENT_CAT_TABLE_INFO_POST === TRUE){
 254  $CONTENT_CAT_TABLE_INFO_POST = " ";
 255  return $CONTENT_CAT_TABLE_INFO_POST;
 256  }
 257  SC_END
 258  
 259  SC_BEGIN CONTENT_CAT_TABLE_ICON
 260  global $CONTENT_CAT_TABLE_ICON, $aa, $totalitems, $row, $content_pref, $qs, $content_cat_icon_path_large, $mainparent;
 261  if(isset($content_pref["content_catall_icon"]) && $content_pref["content_catall_icon"]){
 262      //$qry = ($totalitems > 0 ? "cat.".$row['content_id'] : "");
 263      $qry = "cat.".$row['content_id'];
 264      return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, $qry, "", $content_pref["content_blank_caticon"]);
 265  }
 266  SC_END
 267  
 268  SC_BEGIN CONTENT_CAT_TABLE_HEADING
 269  global $CONTENT_CAT_TABLE_HEADING, $row, $totalitems, $tp;
 270  //return ($totalitems > 0 ? "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : $tp -> toHTML($row['content_heading'], TRUE, "") );
 271  return "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>";
 272  SC_END
 273  
 274  SC_BEGIN CONTENT_CAT_TABLE_AMOUNT
 275  global $CONTENT_CAT_TABLE_AMOUNT, $aa, $row, $totalitems, $mainparent, $content_pref;
 276  if(isset($content_pref["content_catall_amount"]) && $content_pref["content_catall_amount"]){
 277  $n = $totalitems;
 278  $CONTENT_CAT_TABLE_AMOUNT = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54);
 279  return $CONTENT_CAT_TABLE_AMOUNT;
 280  }
 281  SC_END
 282  
 283  SC_BEGIN CONTENT_CAT_TABLE_SUBHEADING
 284  global $CONTENT_CAT_TABLE_SUBHEADING, $row, $tp, $mainparent, $content_pref;
 285  if(isset($content_pref["content_catall_subheading"]) && $content_pref["content_catall_subheading"]){
 286  return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
 287  }
 288  SC_END
 289  
 290  SC_BEGIN CONTENT_CAT_TABLE_DATE
 291  global $CONTENT_CAT_TABLE_DATE, $gen, $row, $mainparent, $content_pref, $gen;
 292  if(isset($content_pref["content_catall_date"]) && $content_pref["content_catall_date"]){
 293  if(!is_object($gen)){ $gen = new convert; }
 294  $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
 295  $DATE = ($datestamp != "" ? $datestamp : "");
 296  return $DATE;
 297  }
 298  SC_END
 299  
 300  SC_BEGIN CONTENT_CAT_TABLE_AUTHORDETAILS
 301  global $CONTENT_CAT_TABLE_AUTHORDETAILS;
 302  return $CONTENT_CAT_TABLE_AUTHORDETAILS;
 303  SC_END
 304  
 305  SC_BEGIN CONTENT_CAT_TABLE_EPICONS
 306  global $CONTENT_CAT_TABLE_EPICONS, $row, $tp, $mainparent, $content_pref;
 307  $EPICONS = "";
 308  if($row['content_pe'] && isset($content_pref["content_catall_peicon"]) && $content_pref["content_catall_peicon"]){
 309      $EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}");
 310      $EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}");
 311      $EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 312  return $EPICONS;
 313  }
 314  SC_END
 315  
 316  SC_BEGIN CONTENT_CAT_TABLE_COMMENT
 317  global $CONTENT_CAT_TABLE_COMMENT, $row, $qs, $comment_total, $mainparent, $content_pref, $plugintable;
 318  if($row['content_comment'] && isset($content_pref["content_catall_comment"]) && $content_pref["content_catall_comment"]){
 319  $sqlc = new db;
 320  $comment_total = $sqlc -> db_Select("comments", "*",  "comment_item_id='".$row['content_id']."' AND comment_type='".$plugintable."' AND comment_pid='0' ");
 321  return "<a style='text-decoration:none;' href='".e_SELF."?cat.".$row['content_id'].".comment'>".CONTENT_LAN_57." ".$comment_total."</a>";
 322  }
 323  SC_END
 324  
 325  SC_BEGIN CONTENT_CAT_TABLE_TEXT
 326  global $CONTENT_CAT_TABLE_TEXT, $row, $tp, $mainparent, $content_pref;
 327  if($row['content_text'] && isset($content_pref["content_catall_text"]) && $content_pref["content_catall_text"] && ($content_pref["content_catall_text_char"] > 0 || $content_pref["content_catall_text_char"] == 'all')){
 328      if($content_pref["content_catall_text_char"] == 'all'){
 329          $CONTENT_CAT_TABLE_TEXT = $row['content_text'];
 330      }else{
 331          $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']);
 332          $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak");
 333          
 334          $rowtext = strip_tags($rowtext);
 335          $words = explode(" ", $rowtext);
 336          $CONTENT_CAT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_catall_text_char"]));
 337          if($content_pref["content_catall_text_link"]){
 338              $CONTENT_CAT_TABLE_TEXT .= " <a href='".e_SELF."?cat.".$row['content_id']."'>".$content_pref["content_catall_text_post"]."</a>";
 339          }else{
 340              $CONTENT_CAT_TABLE_TEXT .= " ".$content_pref["content_catall_text_post"];
 341          }
 342      }
 343  return $CONTENT_CAT_TABLE_TEXT;
 344  }
 345  SC_END
 346  
 347  SC_BEGIN CONTENT_CAT_TABLE_RATING
 348  global $CONTENT_CAT_TABLE_RATING, $row, $rater, $mainparent, $content_pref, $plugintable;
 349  $RATING = "";
 350  if($row['content_rate'] && isset($content_pref["content_catall_rating"]) && $content_pref["content_catall_rating"]){
 351  return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE);
 352  }
 353  return $RATING;
 354  SC_END
 355  
 356  // CONTENT_CAT_LIST_TABLE ------------------------------------------------
 357  SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_PRE
 358  global $CONTENT_CAT_LIST_TABLE_INFO_PRE;
 359  if($CONTENT_CAT_LIST_TABLE_INFO_PRE === TRUE){
 360  $CONTENT_CAT_LIST_TABLE_INFO_PRE = " ";
 361  return $CONTENT_CAT_LIST_TABLE_INFO_PRE;
 362  }
 363  SC_END
 364  SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_POST
 365  global $CONTENT_CAT_LIST_TABLE_INFO_POST;
 366  if($CONTENT_CAT_LIST_TABLE_INFO_POST === TRUE){
 367  $CONTENT_CAT_LIST_TABLE_INFO_POST = " ";
 368  return $CONTENT_CAT_LIST_TABLE_INFO_POST;
 369  }
 370  SC_END
 371  
 372  SC_BEGIN CONTENT_CAT_LIST_TABLE_ICON
 373  global $CONTENT_CAT_LIST_TABLE_ICON, $aa, $row, $qs, $content_pref, $content_cat_icon_path_large, $mainparent;
 374  if(isset($content_pref["content_cat_icon"]) && $content_pref["content_cat_icon"]){
 375  return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]);;
 376  }
 377  SC_END
 378  
 379  SC_BEGIN CONTENT_CAT_LIST_TABLE_HEADING
 380  global $CONTENT_CAT_LIST_TABLE_HEADING, $tp, $row, $totalparent, $tp;
 381  //return ($totalparent > 0 ? "<a href='".e_SELF."?cat.".$row['content_id'].".view'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : $tp -> toHTML($row['content_heading'], TRUE, "") );
 382  return "<a href='".e_SELF."?cat.".$row['content_id'].".view'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>";
 383  SC_END
 384  
 385  SC_BEGIN CONTENT_CAT_LIST_TABLE_SUMMARY
 386  global $CONTENT_CAT_LIST_TABLE_SUMMARY, $tp, $row, $mainparent;
 387  return ($row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : "");
 388  SC_END
 389  
 390  SC_BEGIN CONTENT_CAT_LIST_TABLE_TEXT
 391  global $CONTENT_CAT_LIST_TABLE_TEXT, $tp, $row, $mainparent, $content_pref;
 392  if($row['content_text'] && isset($content_pref["content_cat_text"]) && $content_pref["content_cat_text"] && ($content_pref["content_cat_text_char"] > 0 || $content_pref["content_cat_text_char"] == 'all')){
 393      if($content_pref["content_cat_text_char"] == 'all'){
 394          //$CONTENT_CAT_LIST_TABLE_TEXT = $row['content_text'];
 395          $CONTENT_CAT_LIST_TABLE_TEXT = $tp->toHTML($row['content_text'], TRUE, "constants");
 396      }else{
 397          $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']);
 398          $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak, constants");
 399          
 400          $rowtext = strip_tags($rowtext);
 401          $words = explode(" ", $rowtext);
 402          $CONTENT_CAT_LIST_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_cat_text_char"]));
 403          if($content_pref["content_cat_text_link"]){
 404              $CONTENT_CAT_LIST_TABLE_TEXT .= " <a href='".e_SELF."?cat.".$row['content_id'].".view'>".$content_pref["content_cat_text_post"]."</a>";
 405          }else{
 406              $CONTENT_CAT_LIST_TABLE_TEXT .= " ".$content_pref["content_cat_text_post"];
 407          }
 408      }
 409  return $CONTENT_CAT_LIST_TABLE_TEXT;
 410  }
 411  SC_END
 412  
 413  SC_BEGIN CONTENT_CAT_LIST_TABLE_AMOUNT
 414  global $CONTENT_CAT_LIST_TABLE_AMOUNT, $aa, $row, $mainparent, $content_pref, $totalparent;
 415  if(isset($content_pref["content_cat_amount"]) && $content_pref["content_cat_amount"]){
 416  $n = $totalparent;
 417  $n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54);
 418  return $n;
 419  }
 420  SC_END
 421  
 422  SC_BEGIN CONTENT_CAT_LIST_TABLE_SUBHEADING
 423  global $CONTENT_CAT_LIST_TABLE_SUBHEADING, $tp, $row, $mainparent, $content_pref;
 424  if(isset($content_pref["content_cat_subheading"]) && $content_pref["content_cat_subheading"]){
 425  return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
 426  }
 427  SC_END
 428  
 429  SC_BEGIN CONTENT_CAT_LIST_TABLE_DATE
 430  global $CONTENT_CAT_LIST_TABLE_DATE, $row, $gen, $mainparent, $content_pref, $gen;
 431  if(isset($content_pref["content_cat_date"]) && $content_pref["content_cat_date"]){
 432  if(!is_object($gen)){ $gen = new convert; }
 433  $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
 434  return ($datestamp != "" ? $datestamp : "");
 435  }
 436  SC_END
 437  
 438  SC_BEGIN CONTENT_CAT_LIST_TABLE_AUTHORDETAILS
 439  global $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS;
 440  return $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS;
 441  SC_END
 442  
 443  SC_BEGIN CONTENT_CAT_LIST_TABLE_EPICONS
 444  global $CONTENT_CAT_LIST_TABLE_EPICONS, $row, $tp, $qs, $mainparent, $content_pref;
 445  $EPICONS = "";
 446  if( (isset($content_pref["content_cat_peicon"]) && $content_pref["content_cat_peicon"] && $row['content_pe']) || (isset($content_pref["content_cat_peicon_all"]) && $content_pref["content_cat_peicon_all"])){
 447      $EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.$qs[1]}");
 448      $EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.$qs[1]}");
 449      $EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.$qs[1]}");
 450  return $EPICONS;
 451  }
 452  SC_END
 453  
 454  SC_BEGIN CONTENT_CAT_LIST_TABLE_COMMENT
 455  global $CONTENT_CAT_LIST_TABLE_COMMENT, $qs, $row, $comment_total, $mainparent, $content_pref, $sql, $plugintable;
 456  if($row['content_comment'] && isset($content_pref["content_cat_comment"]) && $content_pref["content_cat_comment"]){
 457      $comment_total = $sql -> db_Count("comments", "(*)",  "WHERE comment_item_id='".intval($qs[1])."' AND comment_type='".$plugintable."' AND comment_pid='0' ");
 458      return "<a style='text-decoration:none;' href='".e_SELF."?cat.".$qs[1].".comment'>".CONTENT_LAN_57." ".$comment_total."</a>";
 459  }
 460  SC_END
 461  
 462  SC_BEGIN CONTENT_CAT_LIST_TABLE_RATING
 463  global $CONTENT_CAT_LIST_TABLE_RATING, $row, $rater, $content_pref, $mainparent, $plugintable;
 464  $RATING = "";
 465  if( (isset($content_pref["content_cat_rating_all"]) && $content_pref["content_cat_rating_all"]) || (isset($content_pref["content_cat_rating"]) && $content_pref["content_cat_rating"] && $row['content_rate'])){
 466      return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE);
 467  }
 468  return $RATING;
 469  SC_END
 470  
 471  // CONTENT_CAT_LISTSUB ------------------------------------------------
 472  SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_ICON
 473  global $CONTENT_CAT_LISTSUB_TABLE_ICON, $aa, $row, $content_pref, $qs, $mainparent, $content_cat_icon_path_small;
 474  if(isset($content_pref["content_catsub_icon"]) && $content_pref["content_catsub_icon"]){
 475  return $aa -> getIcon("catsmall", $row['content_icon'], $content_cat_icon_path_small, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]);
 476  }
 477  SC_END
 478  
 479  SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_HEADING
 480  global $CONTENT_CAT_LISTSUB_TABLE_HEADING, $tp, $row, $totalsubcat, $tp;
 481  //return ($totalsubcat > 0 ? "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : $tp -> toHTML($row['content_heading'], TRUE, "") );
 482  return "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>";
 483  SC_END
 484  
 485  SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_AMOUNT
 486  global $CONTENT_CAT_LISTSUB_TABLE_AMOUNT, $aa, $row, $content_pref, $mainparent, $totalsubcat;
 487  if(isset($content_pref["content_catsub_amount"]) && $content_pref["content_catsub_amount"]){
 488  $n = $totalsubcat;
 489  $n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54);
 490  return $n;
 491  }
 492  SC_END
 493  
 494  SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_SUBHEADING
 495  global $CONTENT_CAT_LISTSUB_TABLE_SUBHEADING, $row, $tp, $content_pref, $mainparent;
 496  if(isset($content_pref["content_catsub_subheading"]) && $content_pref["content_catsub_subheading"]){
 497  return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
 498  }
 499  SC_END
 500  
 501  // CONTENT_SEARCH_TABLE ------------------------------------------------
 502  SC_BEGIN CONTENT_SEARCH_TABLE_SELECT
 503  global $CONTENT_SEARCH_TABLE_SELECT;
 504  return $CONTENT_SEARCH_TABLE_SELECT;
 505  SC_END
 506  
 507  SC_BEGIN CONTENT_SEARCH_TABLE_ORDER
 508  global $CONTENT_SEARCH_TABLE_ORDER;
 509  return $CONTENT_SEARCH_TABLE_ORDER;
 510  SC_END
 511  
 512  SC_BEGIN CONTENT_SEARCH_TABLE_KEYWORD
 513  global $CONTENT_SEARCH_TABLE_KEYWORD;
 514  return $CONTENT_SEARCH_TABLE_KEYWORD;
 515  SC_END
 516  
 517  // CONTENT_SEARCHRESULT_TABLE ------------------------------------------------
 518  SC_BEGIN CONTENT_SEARCHRESULT_TABLE_ICON
 519  global $CONTENT_SEARCHRESULT_TABLE_ICON, $aa, $row, $content_icon_path, $qs, $content_pref, $mainparent;
 520  $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100");
 521  return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]);
 522  SC_END
 523  
 524  SC_BEGIN CONTENT_SEARCHRESULT_TABLE_HEADING
 525  global $CONTENT_SEARCHRESULT_TABLE_HEADING, $row, $qs, $tp;
 526  return ($row['content_heading'] ? "<a href='".e_SELF."?content.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : "");
 527  SC_END
 528  
 529  SC_BEGIN CONTENT_SEARCHRESULT_TABLE_SUBHEADING
 530  global $CONTENT_SEARCHRESULT_TABLE_SUBHEADING, $row, $tp;
 531  return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
 532  SC_END
 533  
 534  SC_BEGIN CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS
 535  global $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS, $qs, $aa, $row;
 536  $authordetails = $aa -> getAuthor($row['content_author']);
 537  $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS = $authordetails[1];
 538  if(USER){
 539      if(is_numeric($authordetails[3])){
 540          $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " <a href='".e_BASE."user.php?id.".$authordetails[0]."' title='".CONTENT_LAN_40."'>".CONTENT_ICON_USER."</a>";
 541      }else{
 542          $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER;
 543      }
 544  }else{
 545      $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER;
 546  }
 547  $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " <a href='".e_SELF."?author.".$row['content_id']."' title='".CONTENT_LAN_39."'>".CONTENT_ICON_AUTHORLIST."</a>";
 548  return $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS;
 549  SC_END
 550  
 551  SC_BEGIN CONTENT_SEARCHRESULT_TABLE_DATE
 552  global $CONTENT_SEARCHRESULT_TABLE_DATE, $gen, $row;
 553  $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short"));
 554  return $datestamp;
 555  SC_END
 556  
 557  SC_BEGIN CONTENT_SEARCHRESULT_TABLE_TEXT
 558  global $CONTENT_SEARCHRESULT_TABLE_TEXT, $row, $tp;
 559  return ($row['content_text'] ? $tp -> toHTML($row['content_text'], TRUE, "") : "");
 560  SC_END
 561  
 562  // CONTENT_RECENT_TABLE ------------------------------------------------
 563  SC_BEGIN CONTENT_RECENT_TABLE_INFOPRE
 564  global $CONTENT_RECENT_TABLE_INFOPRE;
 565  if($CONTENT_RECENT_TABLE_INFOPRE === TRUE){
 566  $CONTENT_RECENT_TABLE_INFOPRE = " ";
 567  return $CONTENT_RECENT_TABLE_INFOPRE;
 568  }
 569  SC_END
 570  SC_BEGIN CONTENT_RECENT_TABLE_INFOPOST
 571  global $CONTENT_RECENT_TABLE_INFOPOST;
 572  if($CONTENT_RECENT_TABLE_INFOPOST === TRUE){
 573  $CONTENT_RECENT_TABLE_INFOPOST = " ";
 574  return $CONTENT_RECENT_TABLE_INFOPOST;
 575  }
 576  SC_END
 577  
 578  SC_BEGIN CONTENT_RECENT_TABLE_ICON
 579  global $CONTENT_RECENT_TABLE_ICON, $aa, $row, $content_icon_path, $content_pref, $mainparent;
 580  if(isset($content_pref["content_list_icon"]) && $content_pref["content_list_icon"]){
 581  $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100");
 582  return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]);
 583  }
 584  SC_END
 585  
 586  SC_BEGIN CONTENT_RECENT_TABLE_HEADING
 587  global $CONTENT_RECENT_TABLE_HEADING, $row, $tp;
 588  return ($row['content_heading'] ? "<a href='".e_SELF."?content.".$row['content_id']."'>".$tp->toHTML($row['content_heading'], TRUE, "")."</a>" : "");
 589  SC_END
 590  
 591  SC_BEGIN CONTENT_RECENT_TABLE_SUBHEADING
 592  global $CONTENT_RECENT_TABLE_SUBHEADING, $tp, $content_pref, $qs, $row, $mainparent;
 593  if (isset($content_pref["content_list_subheading"]) && $content_pref["content_list_subheading"] && $row['content_subheading'] && $content_pref["content_list_subheading_char"] && $content_pref["content_list_subheading_char"] != "" && $content_pref["content_list_subheading_char"] != "0"){
 594      if(strlen($row['content_subheading']) > $content_pref["content_list_subheading_char"]) {
 595          $row['content_subheading'] = substr($row['content_subheading'], 0, $content_pref["content_list_subheading_char"]).$content_pref["content_list_subheading_post"];
 596      }
 597      $CONTENT_RECENT_TABLE_SUBHEADING = ($row['content_subheading'] != "" && $row['content_subheading'] != " " ? $row['content_subheading'] : "");
 598  }else{
 599      $CONTENT_RECENT_TABLE_SUBHEADING = ($row['content_subheading'] ? $row['content_subheading'] : "");
 600  }
 601  return $tp->toHTML($CONTENT_RECENT_TABLE_SUBHEADING, TRUE, "");
 602  SC_END
 603  
 604  SC_BEGIN CONTENT_RECENT_TABLE_SUMMARY
 605  global $CONTENT_RECENT_TABLE_SUMMARY, $content_pref, $tp, $qs, $row, $mainparent;
 606  if (isset($content_pref["content_list_summary"]) && $content_pref["content_list_summary"]){
 607      if($row['content_summary'] && $content_pref["content_list_summary_char"] && $content_pref["content_list_summary_char"] != "" && $content_pref["content_list_summary_char"] != "0"){
 608          if(strlen($row['content_summary']) > $content_pref["content_list_summary_char"]) {
 609              $row['content_summary'] = substr($row['content_summary'], 0, $content_pref["content_list_summary_char"]).$content_pref["content_list_summary_post"];
 610          }
 611          $CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] != "" && $row['content_summary'] != " " ? $row['content_summary'] : "");
 612      }else{
 613          $CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] ? $row['content_summary'] : "");
 614      }
 615  return $tp->toHTML($CONTENT_RECENT_TABLE_SUMMARY, TRUE, "");
 616  }
 617  SC_END
 618  
 619  SC_BEGIN CONTENT_RECENT_TABLE_TEXT
 620  global $CONTENT_RECENT_TABLE_TEXT, $content_pref, $qs, $row, $mainparent, $tp;
 621  if(isset($content_pref["content_list_text"]) && $content_pref["content_list_text"] && $content_pref["content_list_text_char"] > 0){
 622      $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']);
 623      //$rowtext = str_replace ("<br />", " ", $rowtext);
 624      $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak");
 625      $rowtext = strip_tags($rowtext);
 626      $words = explode(" ", $rowtext);
 627      $CONTENT_RECENT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_list_text_char"]));
 628      if($CONTENT_RECENT_TABLE_TEXT){
 629          if($content_pref["content_list_text_link"]){
 630              $CONTENT_RECENT_TABLE_TEXT .= " <a href='".e_SELF."?content.".$row['content_id']."'>".$content_pref["content_list_text_post"]."</a>";
 631          }else{
 632              $CONTENT_RECENT_TABLE_TEXT .= " ".$content_pref["content_list_text_post"];
 633          }
 634      }
 635  }
 636  return $CONTENT_RECENT_TABLE_TEXT;
 637  SC_END
 638  
 639  SC_BEGIN CONTENT_RECENT_TABLE_DATE
 640  global $CONTENT_RECENT_TABLE_DATE, $content_pref, $qs, $row, $mainparent;
 641  if(isset($content_pref["content_list_date"]) && $content_pref["content_list_date"]){
 642  $datestyle = ($content_pref["content_list_datestyle"] ? $content_pref["content_list_datestyle"] : "%d %b %Y");
 643  return strftime($datestyle, $row['content_datestamp']);
 644  }
 645  SC_END
 646  
 647  SC_BEGIN CONTENT_RECENT_TABLE_EPICONS
 648  global $CONTENT_RECENT_TABLE_EPICONS, $tp, $content_pref, $qs, $row, $mainparent;
 649  $CONTENT_RECENT_TABLE_EPICONS = "";
 650  if(isset($content_pref["content_list_peicon"]) && $content_pref["content_list_peicon"]){
 651      if($row['content_pe'] || isset($content_pref["content_list_peicon_all"]) && $content_pref["content_list_peicon_all"]){
 652          $CONTENT_RECENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 653          $CONTENT_RECENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 654          $CONTENT_RECENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 655      }
 656  }
 657  return $CONTENT_RECENT_TABLE_EPICONS;
 658  SC_END
 659  
 660  SC_BEGIN CONTENT_RECENT_TABLE_AUTHORDETAILS
 661  global $CONTENT_RECENT_TABLE_AUTHORDETAILS;
 662  return $CONTENT_RECENT_TABLE_AUTHORDETAILS;
 663  SC_END
 664  
 665  SC_BEGIN CONTENT_RECENT_TABLE_EDITICON
 666  global $CONTENT_RECENT_TABLE_EDITICON, $content_pref, $qs, $row, $mainparent, $plugindir;
 667  if(ADMIN && getperms("P") && isset($content_pref["content_list_editicon"]) && $content_pref["content_list_editicon"]){
 668  return $CONTENT_RECENT_TABLE_EDITICON = "<a href='".$plugindir."admin_content_config.php?content.edit.".$row['content_id']."'>".CONTENT_ICON_EDIT."</a>";
 669  }
 670  SC_END
 671  
 672  SC_BEGIN CONTENT_RECENT_TABLE_REFER
 673  global $CONTENT_RECENT_TABLE_REFER, $content_pref, $qs, $row, $mainparent;
 674  if($content_pref["content_log"] && $content_pref["content_list_refer"]){
 675      $refercounttmp = explode("^", $row['content_refer']);
 676      $CONTENT_RECENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : "0");
 677      if($CONTENT_RECENT_TABLE_REFER > 0){
 678          return $CONTENT_RECENT_TABLE_REFER;
 679      }
 680  }
 681  SC_END
 682  
 683  SC_BEGIN CONTENT_RECENT_TABLE_RATING
 684  global $CONTENT_RECENT_TABLE_RATING, $rater, $row, $qs, $content_pref, $plugintable, $mainparent;
 685  if($content_pref["content_list_rating"]){
 686      if($content_pref["content_list_rating_all"] || $row['content_rate']){
 687          return $rater->composerating($plugintable, $row['content_id'], $enter=FALSE, $userid=FALSE);
 688      }
 689  }
 690  SC_END
 691  
 692  SC_BEGIN CONTENT_RECENT_TABLE_PARENT
 693  global $CONTENT_RECENT_TABLE_PARENT, $content_pref, $mainparent, $row, $array, $aa;
 694  if(isset($content_pref["content_list_parent"]) && $content_pref["content_list_parent"]){
 695  return $aa -> getCrumbItem($row['content_parent'], $array);
 696  }
 697  SC_END
 698  
 699  // CONTENT_ARCHIVE_TABLE ------------------------------------------------
 700  SC_BEGIN CONTENT_ARCHIVE_TABLE_LETTERS
 701  global $CONTENT_ARCHIVE_TABLE_LETTERS, $content_pref, $mainparent;
 702  if($content_pref["content_archive_letterindex"]){
 703  return $CONTENT_ARCHIVE_TABLE_LETTERS;
 704  }
 705  SC_END
 706  
 707  SC_BEGIN CONTENT_ARCHIVE_TABLE_HEADING
 708  global $CONTENT_ARCHIVE_TABLE_HEADING, $row, $qs;
 709  return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
 710  SC_END
 711  
 712  SC_BEGIN CONTENT_ARCHIVE_TABLE_DATE
 713  global $CONTENT_ARCHIVE_TABLE_DATE, $row, $content_pref, $qs, $mainparent;
 714  if(isset($content_pref["content_archive_date"]) && $content_pref["content_archive_date"]){
 715  $datestyle = ($content_pref["content_archive_datestyle"] ? $content_pref["content_archive_datestyle"] : "%d %b %Y");
 716  return strftime($datestyle, $row['content_datestamp']);
 717  }
 718  SC_END
 719  
 720  SC_BEGIN CONTENT_ARCHIVE_TABLE_AUTHOR
 721  global $CONTENT_ARCHIVE_TABLE_AUTHOR;
 722  return $CONTENT_ARCHIVE_TABLE_AUTHOR;
 723  SC_END
 724  
 725  // CONTENT_CONTENT_TABLE ------------------------------------------------
 726  SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE
 727  global $CONTENT_CONTENT_TABLE_INFO_PRE;
 728  if($CONTENT_CONTENT_TABLE_INFO_PRE === TRUE){
 729  $CONTENT_CONTENT_TABLE_INFO_PRE = " ";
 730  return $CONTENT_CONTENT_TABLE_INFO_PRE;
 731  }
 732  SC_END
 733  SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST
 734  global $CONTENT_CONTENT_TABLE_INFO_POST;
 735  if($CONTENT_CONTENT_TABLE_INFO_POST === TRUE){
 736  $CONTENT_CONTENT_TABLE_INFO_POST = " ";
 737  return $CONTENT_CONTENT_TABLE_INFO_POST;
 738  }
 739  SC_END
 740  
 741  SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA
 742  global $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA;
 743  if($CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA === TRUE){
 744  $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = " ";
 745  return $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA;
 746  }
 747  SC_END
 748  SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA
 749  global $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA;
 750  if($CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA === TRUE){
 751  $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = " ";
 752  return $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA;
 753  }
 754  SC_END
 755  
 756  SC_BEGIN CONTENT_CONTENT_TABLE_PARENT
 757  global $CONTENT_CONTENT_TABLE_PARENT, $aa, $array, $row, $content_pref, $mainparent;
 758  if(isset($content_pref["content_content_parent"]) && $content_pref["content_content_parent"]){
 759  return $aa -> getCrumbItem($row['content_parent'], $array);
 760  }
 761  SC_END
 762  
 763  SC_BEGIN CONTENT_CONTENT_TABLE_ICON
 764  global $CONTENT_CONTENT_TABLE_ICON, $qs, $row, $aa, $content_pref, $content_icon_path, $mainparent;
 765  if(isset($content_pref["content_content_icon"]) && $content_pref["content_content_icon"]){
 766  $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100");
 767  return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "", $width, $content_pref["content_blank_icon"]);
 768  }
 769  SC_END
 770  
 771  SC_BEGIN CONTENT_CONTENT_TABLE_HEADING
 772  global $CONTENT_CONTENT_TABLE_HEADING, $row, $tp;
 773  $CONTENT_CONTENT_TABLE_HEADING = ($row['content_heading'] ? $tp -> toHTML($row['content_heading'], TRUE, "") : "");
 774  return $CONTENT_CONTENT_TABLE_HEADING;
 775  SC_END
 776  
 777  SC_BEGIN CONTENT_CONTENT_TABLE_REFER
 778  global $CONTENT_CONTENT_TABLE_REFER, $sql, $qs, $content_pref, $plugintable, $mainparent;
 779  if(isset($content_pref["content_content_refer"]) && $content_pref["content_content_refer"]){
 780      $sql -> db_Select($plugintable, "content_refer", "content_id='".intval($qs[1])."' ");
 781      list($content_refer) = $sql -> db_Fetch();
 782      $refercounttmp = explode("^", $content_refer);
 783      $CONTENT_CONTENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : "");
 784  return $CONTENT_CONTENT_TABLE_REFER;
 785  }
 786  SC_END
 787  
 788  SC_BEGIN CONTENT_CONTENT_TABLE_SUBHEADING
 789  global $CONTENT_CONTENT_TABLE_SUBHEADING, $row, $tp, $content_pref, $qs, $mainparent;
 790  $CONTENT_CONTENT_TABLE_SUBHEADING = ($content_pref["content_content_subheading"] && $row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
 791  return $CONTENT_CONTENT_TABLE_SUBHEADING;
 792  SC_END
 793  
 794  SC_BEGIN CONTENT_CONTENT_TABLE_COMMENT
 795  global $CONTENT_CONTENT_TABLE_COMMENT, $cobj, $qs, $content_pref, $mainparent, $row, $plugintable;
 796  if((isset($content_pref["content_content_comment"]) && $content_pref["content_content_comment"] && $row['content_comment']) || $content_pref["content_content_comment_all"] ){
 797  return $cobj -> count_comments($plugintable, $qs[1]);
 798  }
 799  SC_END
 800  
 801  SC_BEGIN CONTENT_CONTENT_TABLE_DATE
 802  global $CONTENT_CONTENT_TABLE_DATE, $gen, $row, $qs, $content_pref, $mainparent;
 803  if(isset($content_pref["content_content_date"]) && $content_pref["content_content_date"]){
 804      $gen = new convert;
 805      $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
 806      $CONTENT_CONTENT_TABLE_DATE = ($datestamp != "" ? $datestamp : "");
 807  return $CONTENT_CONTENT_TABLE_DATE;
 808  }
 809  SC_END
 810  
 811  SC_BEGIN CONTENT_CONTENT_TABLE_AUTHORDETAILS
 812  global $CONTENT_CONTENT_TABLE_AUTHORDETAILS;
 813  return $CONTENT_CONTENT_TABLE_AUTHORDETAILS;
 814  SC_END
 815  
 816  SC_BEGIN CONTENT_CONTENT_TABLE_EPICONS
 817  global $CONTENT_CONTENT_TABLE_EPICONS, $content_pref, $qs, $row, $tp, $mainparent;
 818  $CONTENT_CONTENT_TABLE_EPICONS = "";
 819  if(($content_pref["content_content_peicon"] && $row['content_pe']) || $content_pref["content_content_peicon_all"]){
 820      $CONTENT_CONTENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 821      $CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 822      $CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
 823  return $CONTENT_CONTENT_TABLE_EPICONS;
 824  }
 825  SC_END
 826  
 827  SC_BEGIN CONTENT_CONTENT_TABLE_EDITICON
 828  global $CONTENT_CONTENT_TABLE_EDITICON, $content_pref, $qs, $row, $plugindir, $mainparent;
 829  if(ADMIN && getperms("P") && isset($content_pref["content_content_editicon"])){
 830      $CONTENT_CONTENT_TABLE_EDITICON = "<a href='".$plugindir."admin_content_config.php?content.edit.".$row['content_id']."'>".CONTENT_ICON_EDIT."</a>";
 831  return $CONTENT_CONTENT_TABLE_EDITICON;
 832  }
 833  SC_END
 834  
 835  SC_BEGIN CONTENT_CONTENT_TABLE_RATING
 836  global $CONTENT_CONTENT_TABLE_RATING, $content_pref, $qs, $row, $rater, $plugintable, $mainparent;
 837  if(($content_pref["content_content_rating"] && $row['content_rate']) || $content_pref["content_content_rating_all"] ){
 838  return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE);
 839  }
 840  SC_END
 841  
 842  SC_BEGIN CONTENT_CONTENT_TABLE_FILE
 843  global $CONTENT_CONTENT_TABLE_FILE, $row, $content_file_path, $content_pref, $mainparent;
 844  if($content_pref["content_content_attach"]){
 845  $filestmp = explode("[file]", $row['content_file']);
 846  foreach($filestmp as $key => $value) { 
 847      if($value == "") { 
 848          unset($filestmp[$key]); 
 849      } 
 850  } 
 851  $files = array_values($filestmp);
 852  $content_files_popup_name = str_replace("'", "", $row['content_heading']);
 853  $file = "";
 854  $filesexisting = "0";
 855  for($i=0;$i<count($files);$i++){
 856      if(file_exists($content_file_path.$files[$i])){
 857          $filesexisting = $filesexisting+1;
 858          $file .= "<a href='".$content_file_path.$files[$i]."' rel='external'>".CONTENT_ICON_FILE."</a> ";                        
 859      }else{
 860          $file .= "&nbsp;";
 861      }
 862  }
 863  $CONTENT_CONTENT_TABLE_FILE = ($filesexisting == "0" ? "" : CONTENT_LAN_41." ".($filesexisting == 1 ? CONTENT_LAN_42 : CONTENT_LAN_43)." ".$file." ");
 864  return $CONTENT_CONTENT_TABLE_FILE;
 865  }
 866  SC_END
 867  
 868  SC_BEGIN CONTENT_CONTENT_TABLE_SCORE
 869  global $CONTENT_CONTENT_TABLE_SCORE, $row;
 870  $score = $row['content_score'];
 871  if($score){
 872      $height = "height:8px;";
 873      $img = "";
 874      $img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
 875      $img .= "<img src='".e_PLUGIN."content/images/score.png' alt='' style='$height width:".$score."px; border:0;' />";
 876      $img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
 877      if($score < 100){
 878          $empty = 100-$score;
 879          $img .= "<img src='".e_PLUGIN."content/images/score_empty.png' alt='' style='$height width:".$empty."px; border:0;' />";
 880      }
 881      $img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
 882      return $img." ".$score;
 883  }
 884  SC_END
 885  
 886  SC_BEGIN CONTENT_CONTENT_TABLE_SUMMARY
 887  global $CONTENT_CONTENT_TABLE_SUMMARY;
 888  return $CONTENT_CONTENT_TABLE_SUMMARY;
 889  SC_END
 890  
 891  SC_BEGIN CONTENT_CONTENT_TABLE_TEXT
 892  global $CONTENT_CONTENT_TABLE_TEXT;
 893  return $CONTENT_CONTENT_TABLE_TEXT;
 894  SC_END
 895  
 896  SC_BEGIN CONTENT_CONTENT_TABLE_IMAGES
 897  global $CONTENT_CONTENT_TABLE_IMAGES, $row, $content_image_path, $aa, $tp, $authordetails, $content_pref, $mainparent;
 898  if($content_pref["content_content_images"]){
 899  $authordetails = $aa -> getAuthor($row['content_author']);
 900  $imagestmp = explode("[img]", $row['content_image']);
 901  foreach($imagestmp as $key => $value) { 
 902      if($value == "") { 
 903          unset($imagestmp[$key]); 
 904      } 
 905  } 
 906  $images = array_values($imagestmp);
 907  $content_image_popup_name = $row['content_heading'];
 908  $CONTENT_CONTENT_TABLE_IMAGES = "";
 909  require_once(e_HANDLER."popup_handler.php");
 910  $pp = new popup;
 911  $gen = new convert;
 912  $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
 913  for($i=0;$i<count($images);$i++){        
 914      $oSrc = $content_image_path.$images[$i];
 915      $oSrcThumb = $content_image_path."thumb_".$images[$i];
 916  
 917      $oIconWidth = (isset($content_pref["content_upload_image_size_thumb"]) && $content_pref["content_upload_image_size_thumb"] ? $content_pref["content_upload_image_size_thumb"] : "100");
 918      
 919      $oMaxWidth = (isset($content_pref["content_upload_image_size"]) && $content_pref["content_upload_image_size"] ? $content_pref["content_upload_image_size"] : "500");
 920      
 921      $subheading    = $tp -> toHTML($row['content_subheading'], TRUE);
 922      $popupname    = $tp -> toHTML($content_image_popup_name, TRUE);
 923      $author        = $tp -> toHTML($authordetails[1], TRUE);
 924      $oTitle        = $popupname." ".($i+1);
 925      $oText        = $popupname." ".($i+1)."<br />".$subheading."<br />".$author." (".$datestamp.")";
 926      $CONTENT_CONTENT_TABLE_IMAGES .= $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText);
 927  }
 928  return $CONTENT_CONTENT_TABLE_IMAGES;
 929  }
 930  SC_END
 931  
 932  SC_BEGIN CONTENT_CONTENT_TABLE_CUSTOM_TAGS
 933  global $CONTENT_CONTENT_TABLE_CUSTOM_TAGS;
 934  return $CONTENT_CONTENT_TABLE_CUSTOM_TAGS;
 935  SC_END
 936  
 937  SC_BEGIN CONTENT_CONTENT_TABLE_PAGENAMES
 938  global $CONTENT_CONTENT_TABLE_PAGENAMES;
 939  return $CONTENT_CONTENT_TABLE_PAGENAMES;
 940  SC_END
 941  
 942  SC_BEGIN CONTENT_CONTENT_TABLE_NEXT_PAGE
 943  global $CONTENT_CONTENT_TABLE_NEXT_PAGE;
 944  return $CONTENT_CONTENT_TABLE_NEXT_PAGE;
 945  SC_END
 946  
 947  SC_BEGIN CONTENT_CONTENT_TABLE_PREV_PAGE
 948  global $CONTENT_CONTENT_TABLE_PREV_PAGE;
 949  return $CONTENT_CONTENT_TABLE_PREV_PAGE;
 950  SC_END
 951  
 952  
 953  
 954  
 955  // PRINT PAGE ------------------------------------------------
 956  
 957  //content images (from uploaded area) used in the print page
 958  SC_BEGIN CONTENT_PRINT_IMAGES
 959  global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent;
 960  if($content_pref["content_content_images"]){
 961  $imagestmp = explode("[img]", $row['content_image']);
 962  foreach($imagestmp as $key => $value) { 
 963      if($value == "") { 
 964          unset($imagestmp[$key]); 
 965      } 
 966  } 
 967  $images = array_values($imagestmp);
 968  $CONTENT_PRINT_IMAGES = "";
 969  for($i=0;$i<count($images);$i++){        
 970      $oSrc = $content_image_path.$images[$i];
 971      $oSrcThumb = $content_image_path."thumb_".$images[$i];
 972  
 973      $iconwidth = (isset($content_pref["content_upload_image_size_thumb"]) && $content_pref["content_upload_image_size_thumb"] ? $content_pref["content_upload_image_size_thumb"] : "100");
 974      if($iconwidth){
 975          $style = "style='width:".$iconwidth."px;'";
 976      }
 977      
 978      //use $image if $thumb doesn't exist
 979      if(file_exists($oSrc)){
 980          if(!file_exists($oSrcThumb)){
 981              $thumb = $oSrc;
 982          }else{
 983              $thumb = $oSrcThumb;
 984          }
 985          $CONTENT_PRINT_IMAGES .= "<img src='".$thumb."' ".$style." alt='' /><br /><br />";
 986      }
 987  }
 988  return $CONTENT_PRINT_IMAGES;
 989  }
 990  SC_END
 991  
 992  
 993  // PDF PAGE ------------------------------------------------
 994  
 995  //content images (from uploaded area) used in the pdf creation
 996  SC_BEGIN CONTENT_PDF_IMAGES
 997  global $CONTENT_PDF_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent;
 998  if($content_pref["content_content_images"]){
 999  $imagestmp = explode("[img]", $row['content_image']);
1000  foreach($imagestmp as $key => $value) { 
1001      if($value == "") { 
1002          unset($imagestmp[$key]); 
1003      } 
1004  } 
1005  $images = array_values($imagestmp);
1006  $CONTENT_PDF_IMAGES = "";
1007  for($i=0;$i<count($images);$i++){        
1008      $oSrc = $content_image_path.$images[$i];
1009      $oSrcThumb = $content_image_path."thumb_".$images[$i];
1010  
1011      $iconwidth = (isset($content_pref["content_upload_image_size_thumb"]) && $content_pref["content_upload_image_size_thumb"] ? $content_pref["content_upload_image_size_thumb"] : "100");
1012      if($iconwidth){
1013          $style = "style='width:".$iconwidth."px;'";
1014      }
1015      
1016      //use $image if $thumb doesn't exist
1017      if(file_exists($oSrc)){
1018          if(!file_exists($oSrcThumb)){
1019              $thumb = $oSrc;
1020          }else{
1021              $thumb = $oSrcThumb;
1022          }
1023          $thumb = $oSrc;
1024          $CONTENT_PDF_IMAGES .= "<img src='".$thumb."' ".$style." alt='' />";
1025      }
1026  }
1027  return $CONTENT_PDF_IMAGES;
1028  }
1029  SC_END
1030  
1031  */
1032  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7