coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: minipoett on February 18, 2006, 10:44:44 PM

Title: change of arrangments in the albums
Post by: minipoett on February 18, 2006, 10:44:44 PM
hey everybody, i don`t know if i post this here at the right place. if not, kick me somewhere else... sorry for that
already for 3 days i`ve been trying to find a way to solve the following problem: i need to change the arrangements of the pix`s in the album. till now we can arrange them by "title", "name", "date" and "position", but i need them to be arranged by "custom fields for image description". does somebody have an idea how to do that. i`m not that good in php, so any idea will help me. where in the script can i find the "arrange by" or "-" or "+"? can i just replace the title, name, date or position somewhere there??
thx for helping
Title: Re: change of arrangments in the albums
Post by: Nibbler on February 18, 2006, 11:09:43 PM
Sort order is here in the theme


// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
                                <td><img src="images/spacer.gif" width="1" alt="" /></td>
                                <td class="sortorder_cell">
                                        <table cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td class="sortorder_options">{TITLE}</td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=ta" title="{SORT_TA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=td" title="{SORT_TD}">&nbsp;-&nbsp;</a></span></td>
                                        </tr>
                                        <tr>
                                                <td class="sortorder_options">{NAME}</td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=na" title="{SORT_NA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=nd" title="{SORT_ND}">&nbsp;-&nbsp;</a></span></td>
                                        </tr>
                                        <tr>
                                                <td class="sortorder_options">{DATE}</td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=da" title="{SORT_DA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=dd" title="{SORT_DD}">&nbsp;-&nbsp;</a></span></td>
                                        </tr>
                                        <tr>
                                                <td class="sortorder_options">{POSITION}</td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=pa" title="{SORT_PA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=pd" title="{SORT_PD}">&nbsp;-&nbsp;</a></span></td>
                                        </tr>
                                        </table>
                                </td>
                        </tr>
                        </table>

EOT;


Copy that into your theme's theme.php and modify to suit. You can add new sort codes into include/functions.inc.php here


        $sort_array = array(
          'na' => 'filename ASC',
          'nd' => 'filename DESC',
          'ta'=>'title ASC',
          'td'=>'title DESC',
          'da' => 'pid ASC',
          'dd' => 'pid DESC',
          'pa' => 'position ASC',
          'pd' => 'position DESC',
        );
Title: Re: change of arrangments in the albums
Post by: minipoett on February 18, 2006, 11:44:52 PM
thank you very much. (hopefully) only one more problem: where can i find in the script the "custom fields for image description"?
it`s really fun to work with this programm. thanx again
Title: Re: change of arrangments in the albums
Post by: minipoett on February 19, 2006, 06:45:51 PM
what i tried till now is finding the part for "custom field for image description" in upload.php:

if(!empty($CONFIG['user_field1_name'])) {
            $form_array[] = array($CONFIG['user_field1_name'], 'user1', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field2_name'])) {
            $form_array[] = array($CONFIG['user_field2_name'], 'user2', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field3_name'])) {
            $form_array[] = array($CONFIG['user_field3_name'], 'user3', 0, 255, 1);
        }

        if(!empty($CONFIG['user_field4_name'])) {
            $form_array[] = array($CONFIG['user_field4_name'], 'user4', 0, 255, 1);
        }

then i changed in include/functions.inc.php for testing only the last description (position) to  "ua" for "user1 ACD" and "ud" for "user1 DESC"


        $sort_array = array(
          'na' => 'filename ASC',
          'nd' => 'filename DESC',
          'ta'=>'title ASC',
          'td'=>'title DESC',
          'da' => 'pid ASC',
          'dd' => 'pid DESC',
          'pa' => 'position ASC',
          'pd' => 'position DESC',

and filled the shortcuts to theme/theme.php.
but it doesn`t work. where is my mistake? i guess "user1" is wrong for the "custom field for image description", but i don`t know what else to do?  ???
Title: Re: change of arrangments in the albums
Post by: Nibbler on February 19, 2006, 06:54:15 PM
It's user1to user4. You don't need to do anything with upload.php. Enable debug mode, post a link to your gallery and post your code if you need support.
Title: Re: change of arrangments in the albums
Post by: minipoett on February 19, 2006, 10:16:08 PM
www.panopti.de
just got to know another thing: i called a lot of friends to visit and check my site and everybody seems to have another design-theme. but i set it to "hardwired" and switched off the design-mode-changing-buttom. does somebody know a solution for me, a quiet unexperienced nurde?
ok, here is the code:


USER:
------------------
Array
(
    [ID] => a006b63e7e59e7d25c3aca5d9750aa08
    [am] => 1
    [theme] => hardwired
    [liv] => Array
        (
            [0] => 2
            [1] => 4
            [2] => 14
        )

    [sort] => pd
    [uid] => 1
    [lang] => german
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => admin
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 3
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg143_filetypes; (0s)
    [1] => select * from cpg143_plugins order by priority asc; (0s)
    [2] => delete from `usr_web184_1`.cpg143_sessions where time<1140379285 and remember=0; (0s)
    [3] => delete from `usr_web184_1`.cpg143_sessions where time<1139173285; (0s)
    [4] => select user_id from `usr_web184_1`.cpg143_sessions where session_id=md5("2499021e0aaf936e51d04d75102723640c492959853dd02e5e20601a450d1616"); (0s)
    [5] => select user_id as id, user_password as password from `usr_web184_1`.cpg143_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `usr_web184_1`.cpg143_users AS u INNER JOIN `usr_web184_1`.cpg143_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `usr_web184_1`.cpg143_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg143_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg143_usergroups WHERE group_id= 1 (0s)
    [10] => update `usr_web184_1`.cpg143_sessions set time='1140382885' where session_id=md5('2499021e0aaf936e51d04d75102723640c492959853dd02e5e20601a450d1616'); (0s)
    [11] => SELECT user_favpics FROM cpg143_favpics WHERE user_id = 1 (0s)
    [12] => DELETE FROM cpg143_banned WHERE expiry < '2006-02-19 21:01:25' (0s)
    [13] => SELECT * FROM cpg143_banned WHERE (ip_addr='85.178.176.41' OR ip_addr='85.178.176.41' OR user_id=1) AND brute_force=0 (0s)
    [14] => UPDATE cpg143_config SET value = '0' WHERE name = 'theme_list' (0.001s)
    [15] => SELECT COUNT(*) FROM cpg143_pictures WHERE approved = 'NO' (0s)
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
    [gallery_name] => www.panopti.de
    [gallery_description] => pictural online laboratory
    [gallery_admin_email] => admin@panopti.de
    [ecards_more_pic_target] => http://web184.metaxa.loswebos.de/
    [home_target] => index.php
    [enable_zipdownload] => 0
    [time_offset] => 0
    [enable_help] => 2
    [clickable_keyword_search] => 1
    [enable_plugins] => 1
    [ban_private_ip] => 0
    [browse_batch_add] => 1
    [lang] => german
    [language_fallback] => 1
    [charset] => utf-8
    [language_list] => 0
    [language_flags] => 1
    [language_reset] => 0
    [theme] => hardwired
    [theme_list] => 0
    [theme_reset] => 0
    [display_faq] => 0
    [custom_lnk_name] =>
    [custom_lnk_url] =>
    [show_bbcode_help] => 1
    [vanity_block] => 1
    [custom_header_path] =>
    [custom_footer_path] =>
    [main_table_width] => 100%
    [subcat_level] => 3
    [albums_per_page] => 12
    [album_list_cols] => 1
    [alb_list_thumb_size] => 60
    [main_page_layout] => catlist/alblist/random
    [first_level] => 1
    [categories_alpha_sort] => 0
    [link_pic_count] => 0
    [thumbcols] => 8
    [thumbrows] => 10
    [max_tabs] => 25
    [caption_in_thumbview] => 0
    [views_in_thumbview] => 0
    [display_comment_count] => 1
    [display_uploader] => 0
    [display_filename] => 0
    [alb_desc_thumb] => 0
    [default_sort_order] => na
    [min_votes_for_rating] => 1
    [picture_table_width] => 600
    [display_pic_info] => 1
    [max_img_desc_length] => 512
    [max_com_wlength] => 38
    [display_film_strip] => 0
    [display_film_strip_filename] => 1
    [max_film_strip_items] => 50
    [slideshow_interval] => 4000
    [filter_bad_words] => 0
    [enable_smilies] => 1
    [disable_comment_flood_protect] => 1
    [max_com_lines] => 50
    [max_com_size] => 1000
    [email_comment_notification] => 0
    [comments_sort_descending] => 0
    [comments_anon_pfx] =>
    [jpeg_qual] => 80
    [thumb_width] => 100
    [thumb_use] => any
    [make_intermediate] => 0
    [picture_width] => 400
    [max_upl_size] => 300
    [max_upl_width_height] => 2500
    [auto_resize] => 1
    [allow_private_albums] => 0
    [show_private] => 0
    [forbiden_fname_char] => $/\\:*?"'<>|` &
    [allowed_img_types] => ALL
    [allowed_mov_types] => ALL
    [media_autostart] => 1
    [allowed_snd_types] => ALL
    [allowed_doc_types] => ALL
    [thumb_method] => gd2
    [impath] =>
    [im_options] => -antialias
    [read_exif_data] => 0
    [read_iptc_data] => 0
    [fullpath] => albums/
    [userpics] => userpics/
    [normal_pfx] => normal_
    [thumb_pfx] => thumb_
    [default_dir_mode] => 0755
    [default_file_mode] => 0644
    [allow_user_registration] => 1
    [allow_unlogged_access] => 1
    [reg_requires_valid_email] => 1
    [reg_notify_admin_email] => 1
    [admin_activation] => 0
    [allow_duplicate_emails_addr] => 0
    [upl_notify_admin_email] => 0
    [allow_memberlist] => 0
    [allow_email_change] => 0
    [users_can_edit_pics] => 1
    [login_threshold] => 5
    [login_expiry] => 10
    [report_post] => 0
    [user_profile1_name] => continent / country / city
    [user_profile2_name] => age
    [user_profile3_name] => occupation
    [user_profile4_name] => how many pictures do you take per week
    [user_profile5_name] => analog / digital (why)
    [user_profile6_name] => for me taking pictures is like ...
    [user_field1_name] => frage_1
    [user_field2_name] => frage_2
    [user_field3_name] => frage_3
    [user_field4_name] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    [cookie_name] => cpg143
    [cookie_path] => /
    [smtp_host] =>
    [smtp_username] =>
    [smtp_password] =>
    [log_mode] => 0
    [log_ecards] => 0
    [vote_details] => 0
    [hit_details] => 0
    [debug_mode] => 2
    [debug_notice] => 0
    [offline] => 0
    [update_config] => Neue Einstellungen speichern
)

==========================
VERSION INFO :
------------------
PHP version: 4.4.0-0.dotdeb.0 - OK
------------------
mySQL version: 4.1.15-Debian_0.dotdeb.1-log
------------------
Coppermine version: 1.4.3(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 4.1.15
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.2
Linked Version 1.2.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/share/php | .:/usr/share/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 32M | 32M
post_max_size | 32M | 32M
==========================
Page generated in 0.251 seconds - 16 queries in 0.001 seconds - Album set : ; Meta set: ;

Title: Re: change of arrangments in the albums
Post by: minipoett on February 19, 2006, 10:17:34 PM
ok, how can i use the scalling-tool for codes? sorry for the mess
Title: Re: change of arrangments in the albums
Post by: Nibbler on February 19, 2006, 10:27:54 PM
Your theme is set to fruity. Clear your cookies before changing the theme in config. I have no idea what a scalling-tool is.
Title: Re: change of arrangments in the albums
Post by: minipoett on February 19, 2006, 10:36:35 PM
oh my god, not the fruity design.
i mean the scalling-tool for getting the code in a smaller box, where you can scrall down...
whatever, thanx for the cookies-advice. but my main problem was the new arrangement of thumbs in an album.
Title: Re: change of arrangments in the albums
Post by: Nibbler on February 19, 2006, 10:40:05 PM
Right, then post the code you have changed in your theme and in functions.inc.php
Title: Re: change of arrangments in the albums
Post by: minipoett on February 19, 2006, 11:22:07 PM
thanx, it`s unbelivable. everything is working absolutly fine.
by the way, did`t you wear a yellow shirt 10 minutes ago??