4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 12, 2018, 11:09:14 PM

Login with username, password and session length
Search:     Advanced search
4images is now on facebook. Click here and become a fan!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] Additional Category fields
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: [Mod] Additional Category fields  (Read 21437 times)
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900

Vienna


View Profile WWW
« on: May 20, 2013, 04:45:45 PM »

Hi!

The additional category fields function as the additional image fields.
They work in the thumbnails in the categories and on the detail side.

Example Mod with "radio" Button

Example Mod with "textarea"


1.) search in admin/categories.php section: ($action == "savecat"):
1
$auth_viewcat intval($HTTP_POST_VARS['auth_viewcat']);
insert above:
1
2
3
4
5
6
7
8
9
10
11
12
13
// ######## Start Mod Additional Category #################  
  
if (!empty($additional_category_fields)) {
    
$additional_field_sql "";
    
$additional_value_sql "";
    
$table_fields $site_db->get_table_fields(CATEGORIES_TABLE);
    foreach (
$additional_category_fields as $key => $val) {
      if (isset(
$HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
        
$additional_field_sql .= ", $key";
        
$additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
      }
    }
  }
// ######## End Mod Additional Category ###################
1.2) search in section: ($action == "savecat"):
1
2
3
4
5
    $sql "INSERT INTO ".CATEGORIES_TABLE."
            (cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
            VALUES
            ('
$cat_name', '$cat_description', $cat_parent_id$cat_order$auth_viewcat$auth_viewimage$auth_download$auth_upload$auth_directupload$auth_vote$auth_sendpostcard$auth_readcomment$auth_postcomment)";

and replace:
1
2
3
4
5
6
// ############## Show below in the SQL Query Mod Additional Category #################
    
$sql "INSERT INTO ".CATEGORIES_TABLE."
            (cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment"
.$additional_field_sql.")
            VALUES
            ('
$cat_name', '$cat_description', $cat_parent_id$cat_order$auth_viewcat$auth_viewimage$auth_download$auth_upload$auth_directupload$auth_vote$auth_sendpostcard$auth_readcomment$auth_postcomment".$additional_value_sql.")";

1.3) search in section: ($action == "addcat"):
1
$permission_headline $lang['permissions'];
insert above:
1
2
3
// ######## Start Mod Additional Category ###################
  
show_additional_fields("category", array(), CATEGORIES_TABLE);
// ######## End Mod Additional Category #####################
1.4) search in section ($action == "updatecat"):
1
$auth_viewcat intval($HTTP_POST_VARS['auth_viewcat']);
insert above:
1
2
3
4
5
6
7
8
9
10
11
// ######## Start Mod Additional Category ##################  
  
if (!empty($additional_category_fields)) {
    
$additional_sql="";
    
$table_fields $site_db->get_table_fields(CATEGORIES_TABLE);
    foreach (
$additional_category_fields as $key => $val) {
      if (isset(
$HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
        
$additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
      }
    }
  }
// ######## End Mod Additional Category ####################
1.5) search in section ($action == "updatecat"):
1
SET cat_name '$cat_name'cat_description '$cat_description'cat_parent_id $cat_parent_idcat_order $cat_ordercat_hits $cat_hitsauth_viewcat $auth_viewcatauth_viewimage $auth_viewimageauth_download $auth_downloadauth_upload $auth_uploadauth_directupload $auth_directuploadauth_vote $auth_voteauth_sendpostcard $auth_sendpostcardauth_readcomment $auth_readcommentauth_postcomment $auth_postcomment
and replace:
1
SET cat_name '$cat_name'cat_description '$cat_description'cat_parent_id $cat_parent_idcat_order $cat_ordercat_hits $cat_hitsauth_viewcat $auth_viewcatauth_viewimage $auth_viewimageauth_download $auth_downloadauth_upload $auth_uploadauth_directupload $auth_directuploadauth_vote $auth_voteauth_sendpostcard $auth_sendpostcardauth_readcomment $auth_readcommentauth_postcomment $auth_postcomment".$additional_sql."
1.6) search in section ($action == "editcat"):
1
 $sql "SELECT cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
and replace:
1
$sql "SELECT *
1.7) search in section ($action == "editcat"):
1
show_table_separator($lang['permissions'], 2);
insert above:
1
2
3
// ######## Start Mod Additional Category ####################  
  
show_additional_fields("category"$cat_rowCATEGORIES_TABLE);
// ######## End Mod Additional Category ######################

2.) search in includes/functions.php in (function show_image):
1
global $self_url$site_template$site_sess$user_info$config$cat_cache$lang$additional_image_fields$user_table_fields$url_show_profile;
and replace:
1
global $self_url$site_template$site_sess$user_info$config$cat_cache$lang$additional_image_fields$user_table_fields$url_show_profile$additional_category_fields;
2.1) search in (function show_image):
1
2
  $rate_form "";
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
insert above:
1
2
3
4
5
6
7
8
9
10
11
12
13
// ######## Start Mod Additional Category #################    
  
if (!empty($additional_category_fields)) {
    
$additional_field_array = array();
    foreach (
$additional_category_fields as $key => $val) {
    
//$additional_sql .= ", c.".$key;
      
$additional_field_array[$key] = (!empty($cat_cache[$image_row['cat_id']][$key])) ? format_text($cat_cache[$image_row['cat_id']][$key], 1) : REPLACE_EMPTY;
      
$additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty(
$additional_field_array)) {
      
$site_template->register_vars($additional_field_array); 
    }
  }
// ######## End Mod Additional Category ####################
2.2) search in (function get_categories):
1
global $cat_cache$cat_parent_cache$new_image_cache$subcat_ids;
and replace:
1
  global $cat_cache$cat_parent_cache$new_image_cache$subcat_ids$additional_category_fields;
2.3) search in (function get_categories):
1
2
      $random_cat_image_file get_random_image($category_id01);
    }
insert below:
1
2
3
4
5
6
7
8
9
10
11
12
// ######## Start Mod Additional Category #################    
    
if (!empty($additional_category_fields)) {
    
$additional_field_array = array();
    foreach (
$additional_category_fields as $key => $val) {
      
$additional_field_array[$key] = (!empty($cat_cache[$category_id][$key])) ? format_text($cat_cache[$category_id][$key], 1) : REPLACE_EMPTY;
      
$additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty(
$additional_field_array)) {
      
$site_template->register_vars($additional_field_array); 
    }
  }
// ######## End Mod Additional Category ###################

3.) search in global.php:
1
if (defined("GET_CACHES")) {
insert above:
1
2
3
4
5
6
7
// ######## Start Mod Additional Category #################
if (!empty($additional_category_fields)) {
  foreach (
$additional_category_fields as $key => $val) {
    
$additional_sql .= ",".$key;
  }
}
// ######## End Mod Additional Category ###################
3.1) search:
1
$sql "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
and replace:
1
$sql "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment".$additional_sql."

mfg Andi
« Last Edit: April 23, 2014, 06:49:28 PM by Rembrandt » Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Jan-Lukas
Addicted member
******
Offline Offline

Posts: 1280

Thank You
-Given: 153
-Receive: 53


View Profile WWW
« Reply #1 on: October 08, 2013, 04:16:35 PM »

Hallo Andy,
So, installiert und keine Fehlermeldung (ist doch was  Wink)
Aber sag mal, wo finde ich denn das Eingabefeld ?
Muss ich noch etwas anderes Installieren, oder fehlt evtl. ein Eintrag in der Sprachdatei ?

das einzigste was ich gefunden habe, unter Kategorie Einstellungen ist dieses (siehe Bild)

LG Harald

* Unbenannt-1.jpg (66.21 KB - downloaded 76 times.)
Logged

Danke Harald



Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900

Vienna


View Profile WWW
« Reply #2 on: October 08, 2013, 07:01:33 PM »

Hi!
...
das einzigste was ich gefunden habe, unter Kategorie Einstellungen ist dieses (siehe Bild)
..
Der Mod hier ist nur die Basis, wenn du jetzt Textfelder oder Radio Buttons haben möchtest mußt du die natürlich erst installieren, genau so wie bei den Additionalen Image fields.
Im ersten Post hier hast du die Links.

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Jan-Lukas
Addicted member
******
Offline Offline

Posts: 1280

Thank You
-Given: 153
-Receive: 53


View Profile WWW
« Reply #3 on: October 09, 2013, 04:46:18 PM »

OK, das ist nicht das Problem, nur wie binde ich es so wie bei dir ein ?

Wenn ich das Kategorie Feld normal einbinde {category_info}
wird es ja nur als Textfeld dort angezeigt wo ich es einbinde.

Aber soll ja wie bei dir nach dem Klick (Kreuz) verschwinden

LG Harald
Logged

Danke Harald



Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900

Vienna


View Profile WWW
« Reply #4 on: October 09, 2013, 05:30:18 PM »

Achso... dann nehme ich mal an das du diesen Mod nicht gesehen hast?
http://www.4homepages.de/forum/index.php?topic=31353.0

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Jan-Lukas
Addicted member
******
Offline Offline

Posts: 1280

Thank You
-Given: 153
-Receive: 53


View Profile WWW
« Reply #5 on: October 09, 2013, 07:45:33 PM »

Nö  Embarassed

Danke für den Schupser

LG
Logged

Danke Harald



.Infecto
Newbie
*
Offline Offline

Posts: 48

Thank You
-Given: 10
-Receive: 0


View Profile
« Reply #6 on: April 23, 2014, 02:02:24 PM »

Wie kann man das Feld auf der Startseite anzeigen lassen?
In der Details.html wird es angezeigt bzw. ausgegeben, aber auf der Startseite leider nicht und in der category_bit auch nicht.

Habe das schon so versucht, aber ich denke es gibt einen einfacheren Weg?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories get_categories(0);
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url,i.image_download_url2,i.image_download_url3,i.image_download_url4,i.image_download_url5,i.image_download_url6,i.image_download_url7,i.image_download_url8, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_downloads2, i.image_downloads3, i.image_downloads4, i.image_downloads5, i.image_downloads6, i.image_downloads7,i.image_downloads8, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name, c.cat_icon".get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_id = 
$image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row $site_db->query_firstrow($sql);
if (!
$categories)  {
  
$categories $lang['no_categories'];
}
$site_template->register_vars("categories"$categories);
$site_template->register_vars(array(
"cat_icon" => format_text($image_row['cat_icon'], 2)
));
unset(
$categories);
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900

Vienna


View Profile WWW
« Reply #7 on: April 23, 2014, 06:51:41 PM »

Hi!
Wie kann man das Feld auf der Startseite anzeigen lassen?
In der Details.html wird es angezeigt bzw. ausgegeben, aber auf der Startseite leider nicht und in der category_bit auch nicht.

Habe das schon so versucht, aber ich denke es gibt einen einfacheren Weg?....
Sry mein Fehler, der Punkt 2.2) wurde geändert, und neu hinzugefügt, Schritt 2.3)

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
.Infecto
Newbie
*
Offline Offline

Posts: 48

Thank You
-Given: 10
-Receive: 0


View Profile
« Reply #8 on: April 29, 2014, 01:51:49 PM »

Ich habe zu danken.
Logged
Tomila
Pre-Newbie

Offline Offline

Posts: 2

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #9 on: July 29, 2014, 05:22:49 PM »

Danke. Ich versuchte es alleine hinzubekommen, aber da bin ich ein wenig am Können gescheitert. Jetzt passt es wundervoll.   
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.222 seconds with 20 queries.
Post your comments here