1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 12:21:45 +02:00

content: categories and subcategories can now be sorted (each has it's own new added preference), used on the category pages

This commit is contained in:
lia
2007-04-17 21:06:06 +00:00
parent 9b5cbebbda
commit e47f8ee167
3 changed files with 114 additions and 34 deletions

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_class.php,v $
| $Revision: 1.18 $
| $Date: 2007-04-16 22:11:09 $
| $Revision: 1.19 $
| $Date: 2007-04-17 21:06:06 $
| $Author: lisa_ $
+---------------------------------------------------------------+
*/
@@ -176,6 +176,7 @@ class content{
$cp['content_catall_text_post'] = CONTENT_LAN_16; //define postfix is text is too long
$cp['content_catall_text_link'] = '1'; //define if link to category should be added on postfix
$cp['content_catall_caption'] = CONTENT_LAN_25; //caption for all categories page
$cp['content_catall_defaultorder'] = 'orderaheading'; //default order for categories on the all categories page
//sections of content category in 'view category' page
$cp['content_cat_icon'] = '1'; //show icon
$cp['content_cat_subheading'] = '1'; //show subheading
@@ -193,6 +194,7 @@ class content{
$cp['content_cat_caption_append_name'] = '1'; //append category heading to caption
$cp['content_cat_sub_caption'] = CONTENT_LAN_28; //caption for subcategories
$cp['content_cat_item_caption'] = CONTENT_LAN_31; //caption for items in category
$cp['content_cat_defaultorder'] = 'orderaheading'; //default order for the subcategories on the single category page
//sections of subcategories in 'view category page'
$cp['content_catsub_icon'] = '1'; //show icon
@@ -1074,7 +1076,7 @@ class content{
return $text;
}
function getOrder(){
function getOrder($mode=''){
global $qs, $content_pref;
if(isset($qs[0]) && substr($qs[0],0,5) == "order"){
@@ -1086,7 +1088,13 @@ class content{
}elseif(isset($qs[3]) && substr($qs[3],0,5) == "order"){
$orderstring = $qs[3];
}else{
$orderstring = ($content_pref["content_defaultorder"] ? $content_pref["content_defaultorder"] : "orderddate" );
if(isset($mode) && $mode=='catall'){
$orderstring = ($content_pref["content_catall_defaultorder"] ? $content_pref["content_catall_defaultorder"] : "orderaheading" );
}elseif(isset($mode) && $mode=='cat'){
$orderstring = ($content_pref['content_cat_defaultorder'] ? $content_pref['content_cat_defaultorder'] : "orderaheading" );
}else{
$orderstring = ($content_pref["content_defaultorder"] ? $content_pref["content_defaultorder"] : "orderddate" );
}
}
if(substr($orderstring,6) == "heading"){
@@ -1104,10 +1112,16 @@ class content{
}elseif(substr($orderstring,6) == "author"){
}elseif(substr($orderstring,6) == "order"){
if($qs[0] == "cat"){
$orderby = "SUBSTRING_INDEX(content_order, '.', 1)+0";
}elseif($qs[0] != "cat"){
$orderby = "SUBSTRING_INDEX(content_order, '.', -1)+0";
if(isset($mode) && $mode=='catall'){
$orderby = "content_order+0";
}elseif(isset($mode) && $mode=='cat'){
$orderby = "content_order+0";
}else{
if($qs[0] == "cat"){
$orderby = "SUBSTRING_INDEX(content_order, '.', 1)+0";
}elseif($qs[0] != "cat"){
$orderby = "SUBSTRING_INDEX(content_order, '.', -1)+0";
}
}
$orderby2 = ", content_heading ASC";
}else{

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_form_class.php,v $
| $Revision: 1.12 $
| $Date: 2007-04-16 22:11:09 $
| $Revision: 1.13 $
| $Date: 2007-04-17 21:06:06 $
| $Author: lisa_ $
+---------------------------------------------------------------+
*/
@@ -2378,6 +2378,20 @@ class contentform{
$TOPIC_FIELD = $rs -> form_text("content_catall_caption", 25, $tp->toHTML($content_pref['content_catall_caption'],"","defs"), 50);
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
//content_catall_defaultorder
$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_51;
$TOPIC_FIELD = "
".$rs -> form_select_open("content_catall_defaultorder")."
".$rs -> form_option(CONTENT_ORDER_LAN_1, ($content_pref['content_catall_defaultorder'] == "orderaheading" ? "1" : "0"), "orderaheading")."
".$rs -> form_option(CONTENT_ORDER_LAN_2, ($content_pref['content_catall_defaultorder'] == "orderdheading" ? "1" : "0"), "orderdheading")."
".$rs -> form_option(CONTENT_ORDER_LAN_3, ($content_pref['content_catall_defaultorder'] == "orderadate" ? "1" : "0"), "orderadate")."
".$rs -> form_option(CONTENT_ORDER_LAN_4, ($content_pref['content_catall_defaultorder'] == "orderddate" ? "1" : "0"), "orderddate")."
".$rs -> form_option(CONTENT_ORDER_LAN_9, ($content_pref['content_catall_defaultorder'] == "orderaorder" ? "1" : "0"), "orderaorder")."
".$rs -> form_option(CONTENT_ORDER_LAN_10, ($content_pref['content_catall_defaultorder'] == "orderdorder" ? "1" : "0"), "orderdorder")."
".$rs -> form_select_close();
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
$text .= $TOPIC_ROW_SPACER;
$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_17;
@@ -2514,6 +2528,19 @@ class contentform{
$TOPIC_FIELD = CONTENT_ADMIN_OPT_LAN_172."<br />".$rs -> form_text("content_cat_levels", 10, $content_pref['content_cat_levels'], 3);
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
//content_cat_defaultorder
$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_51;
$TOPIC_FIELD = "
".$rs -> form_select_open("content_cat_defaultorder")."
".$rs -> form_option(CONTENT_ORDER_LAN_1, ($content_pref['content_cat_defaultorder'] == "orderaheading" ? "1" : "0"), "orderaheading")."
".$rs -> form_option(CONTENT_ORDER_LAN_2, ($content_pref['content_cat_defaultorder'] == "orderdheading" ? "1" : "0"), "orderdheading")."
".$rs -> form_option(CONTENT_ORDER_LAN_3, ($content_pref['content_cat_defaultorder'] == "orderadate" ? "1" : "0"), "orderadate")."
".$rs -> form_option(CONTENT_ORDER_LAN_4, ($content_pref['content_cat_defaultorder'] == "orderddate" ? "1" : "0"), "orderddate")."
".$rs -> form_option(CONTENT_ORDER_LAN_9, ($content_pref['content_cat_defaultorder'] == "orderaorder" ? "1" : "0"), "orderaorder")."
".$rs -> form_option(CONTENT_ORDER_LAN_10, ($content_pref['content_cat_defaultorder'] == "orderdorder" ? "1" : "0"), "orderdorder")."
".$rs -> form_select_close();
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
$text .= $TOPIC_TABLE_END;
$text .= "