diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 12350ad10..b57f79780 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -203,7 +203,7 @@ class page_admin_ui extends e_admin_ui protected $fields = array( 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), 'page_id' => array('title'=> 'ID', 'width'=>'5%', 'forced'=> TRUE), - 'page_title' => array('title'=> LAN_TITLE, 'type' => 'method', 'width'=>'auto'), + 'page_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width'=>'auto','readParms'=>'link={e_BASE}page.php?[id]&dialog=1'), 'page_theme' => array('title'=> CUSLAN_2, 'type' => 'text', 'width' => 'auto','nolist'=>true), 'page_template' => array('title'=> 'Template', 'type' => 'text', 'width' => 'auto'), 'page_author' => array('title'=> LAN_AUTHOR, 'type' => 'user', 'width' => 'auto', 'thclass' => 'left'), diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 5ec747a3e..b7aced76f 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -298,8 +298,8 @@ class news_admin_ui extends e_admin_ui protected $fields = array( 'checkboxes' => array('title' => '', 'type' => null, 'width' => '3%', 'thclass' => 'center first', 'class' => 'center', 'nosort' => true, 'toggle' => 'news_selected', 'forced' => TRUE), 'news_id' => array('title' => LAN_NEWS_45, 'type' => 'number', 'width' => '5%', 'thclass' => 'center', 'class' => 'center', 'nosort' => false), - 'news_thumbnail' => array('title' => NWSLAN_67, 'type' => 'image', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>false), - 'news_title' => array('title' => NWSLAN_40, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), + 'news_thumbnail' => array('title' => NWSLAN_67, 'type' => 'method', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>false), + 'news_title' => array('title' => NWSLAN_40, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'readParms'=>'link={e_BASE}news.php?extend.[id]&dialog=1'), 'news_summary' => array('title' => LAN_NEWS_27, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), 'news_meta_keywords' => array('title' => LAN_KEYWORDS, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), @@ -497,7 +497,20 @@ class news_admin_ui extends e_admin_ui class news_form_ui extends e_admin_form_ui { - + function news_thumbnail($curval,$mode) + { + if(!vartrue($curval)) return; + + if($curval[0] != "{") + { + $curval = "{e_IMAGE}newspost_images/".$curval; + } + + $url = e107::getParser()->thumbUrl($curval,'aw=80'); + $link = e107::getParser()->replaceConstants($curval); + + return "{$curval}"; + } } new news_admin(); @@ -2053,6 +2066,11 @@ class admin_newspost ".$frm->help(LAN_NEWS_23)." "; + if(vartrue($_POST['news_thumbnail']) && $_POST['news_thumbnail'][0] != "{")//BC compat + { + $_POST['news_thumbnail'] = "{e_IMAGE}newspost_images/".$_POST['news_thumbnail']; + } + $text .= $frm->imagepicker('news_thumbnail', $_POST['news_thumbnail'],'','news'); diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 553d7c10a..74f03a1cd 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -446,6 +446,18 @@ class news_shortcodes extends e_shortcode return $info; } + function sc_newstags($parm=5) + { + $tmp = explode(",",$this->news_item['news_meta_keywords']); + $words = array(); + foreach($tmp as $val) + { + $words[] = "".$val.""; + + } + return implode(", ",$words); + } + } ?> \ No newline at end of file diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index f59d45242..6927f7ed4 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -4566,8 +4566,8 @@ class e_admin_form_ui extends e_form break; case 'userclass': - //case 'userclasses': - $classes = e107::getUserClass()->uc_required_class_list(vartrue($parms['classlist'], '')); + case 'userclasses': + $classes = e107::getUserClass()->uc_required_class_list(vartrue($parms['classlist'], 'public,nobody,guest,admin,main,classes')); foreach($classes as $k => $name) { $option[$key.'__'.$k] = $name; diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 651545ba3..23d8c93df 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -1587,7 +1587,7 @@ class e_form if(!is_array($attributes['readParms'])) parse_str($attributes['readParms'], $attributes['readParms']); $parms = $attributes['readParms']; } - + $tp = e107::getParser(); switch($field) // special fields { @@ -1741,7 +1741,7 @@ class e_form break; case 'text': - + if(vartrue($parms['truncate'])) { $value = $tp->text_truncate($value, $parms['truncate'], '...'); @@ -1754,6 +1754,14 @@ class e_form { $value = $tp->htmlwrap($value, (int)$parms['wrap'], varset($parms['wrapChar'], ' ')); } + if(vartrue($parms['link']) && $id && is_numeric($id) ) + { + $link = str_replace('[id]',$id,$parms['link']); + $link = $tp->replaceConstants($link); // SEF URL is not important since we're in admin. + $dialog = vartrue($parms['dialog']) ? "e-dialog" : ""; + $value = "".$value.""; + } + $value = vartrue($parms['pre']).$value.vartrue($parms['post']); break; diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index 03a974285..455623349 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -509,7 +509,7 @@ class e_media $media_path = ($w || $h) ? $tp->thumbUrl($im['media_url'], "w={$w}&h={$h}") : $tp->replaceConstants($im['media_url'],'full'); // max-size $realPath = $tp->thumbUrl($im['media_url'], $att); - $diz = $tp->toAttribute($im['media_title']); + $diz = $tp->toAttribute($im['media_title'])."\n".$im['media_dimensions']; $repl = array($im['media_url'],$media_path); if($bbcode == null) // e107 Media Manager @@ -537,8 +537,8 @@ class e_media $img_url = ($cat !='_icon') ? e107::getParser()->thumbUrl($im['media_url'], $att) : $media_path; - $text .= ""; - $text .= "\"".$im['media_title']."\""; + $text .= ""; + $text .= "\"".$im['media_title']."\""; $text .= "\n\n"; } diff --git a/e107_handlers/phpthumb/thumb_plugins/gd_watermarkttf.inc.php b/e107_handlers/phpthumb/thumb_plugins/gd_watermarkttf.inc.php index 7cc2497b4..f20fb9e6f 100644 --- a/e107_handlers/phpthumb/thumb_plugins/gd_watermarkttf.inc.php +++ b/e107_handlers/phpthumb/thumb_plugins/gd_watermarkttf.inc.php @@ -62,6 +62,9 @@ class GdWatermarkTTF $shadowcolor = imagecolorallocatealpha($im, $scol[0], $scol[1], $scol[2], $opacity); $white = imagecolorallocatealpha($im, $col[0], $col[1], $col[2], $opacity); + // imagefilter($shadowcolor, IMG_FILTER_GAUSSIAN_BLUR); + imagefilter($shadowcolor, IMG_FILTER_SELECTIVE_BLUR); + imagettftext($im, $size, 0, $x + 1, $y + 1, $shadowcolor, $font, $text); imagettftext($im, $size, 0, $x -1, $y + 1, $shadowcolor, $font, $text); imagettftext($im, $size, 0, $x + 0, $y + 0, $white, $font, $text); diff --git a/news.php b/news.php index e286220da..33108e216 100644 --- a/news.php +++ b/news.php @@ -46,7 +46,7 @@ if (!defined('ITEMVIEW')) define('ITEMVIEW', varset($pref['newsposts'],15)); } -if (e_QUERY) +if (e_QUERY) //TODO add support for $_GET['cat'] and $_GET['mode'] and phase-out the x.x.x format. { $tmp = explode(".",e_QUERY); @@ -123,7 +123,8 @@ $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'"; // DISPLAY NEWS IN 'CATEGORY' FORMAT HERE //------------------------------------------------------ // Just title and a few other details -if ($action == 'cat' || $action == 'all') + +if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag'])) { // --> Cache if($newsCachedPage = checkCache($cacheString)) { @@ -175,6 +176,22 @@ if ($action == 'cat' || $action == 'all') ORDER BY n.news_datestamp DESC LIMIT ".intval($newsfrom).",".NEWSLIST_LIMIT; } + elseif(vartrue($_GET['tag'])) + { + $tagsearch = preg_replace('#[^a-zA-Z0-9\-]#','', $_GET['tag']); + $query = " + SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon, nc.category_meta_keywords, + nc.category_meta_description{$rewrite_cols_cat}{$rewrite_cols} + FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_meta_keywords LIKE '%".$tagsearch."%' + AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") + AND n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") + ORDER BY n.news_datestamp DESC + LIMIT ".intval($newsfrom).",".NEWSLIST_LIMIT; + $category_name = 'Tag: "'.$tagsearch.'"'; + } $newsList = array(); if($sql->db_Select_gen($query))