Author Topic: Table seperator issue  (Read 3363 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Table seperator issue
« on: January 17, 2010, 12:51:27 PM »
Hello,

A few month ago V@no helped me to organize my ACP when you add a lot of additional fields to your gallery.
I added a table separator between different sections. I do it like this:

Open admin_functions.php
Find:
function show_additional_fields($type "image"$image_row = array(), $table IMAGES_TEMP_TABLE$i 0) {
  global 
$site_db$lang;

  
$field_type_array "additional_".$type."_fields";
  global ${
$field_type_array};

  if (!empty(${
$field_type_array})) {
    
$table_fields $site_db->get_table_fields($table);
    foreach (${
$field_type_array} as $key => $val) {
      if (!isset(
$table_fields[$key])) {
        continue;
      }


Add after:
if (in_array($key, array("user_extra_info")))
      {
        
show_table_separator("user extra info");
      }


It workt perfect till today. I encounter a problem:

What will happend if you have 2 additional fields for images and users with the same name? For example:

$additional_user_fields['user_extra_info'] = array($lang['user_extra_info'], "text", 0);
and
$additional_image_fields['user_extra_info'] = array($lang['user_extra_info'], "text", 0);


I believe you wil get the table seperator in images and users, but what about you don't want it in images? Only in users ACP.


How can we solve that?

Can we use something like:

if (in_array($keyuser_row("user_extra_info")))
      {
        
show_table_separator("user extra info");
      }





Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Table seperator issue
« Reply #1 on: January 17, 2010, 08:17:51 PM »
      if ($type == "user" && in_array($key, array("user_extra_info")))
      {
        
show_table_separator("user extra info");
      }
Your first three "must do" before you ask a question:
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)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Table seperator issue
« Reply #2 on: January 17, 2010, 10:35:35 PM »
Perfect v@no. Thanks man.