Icy Phoenix

     
 

SOLVED - Standard Unrelated Gallery In Personal Gallerys

SOLVED - Standard Unrelated Gallery In Personal Gallerys

Article
Reply with quote    Download Post  
Post SOLVED - Standard Unrelated Gallery In Personal Gallerys 
 
I was wondering if someone could help me out with this.

Say. When a Member creates there personally gallery. The gallery will automatically have a Unrelated Sub Gallery in the members Personal Gallery

Could someone help me with this? Artie?



 
Last edited by Bullet on Thu 25 Jan, 2007 01:26; edited 1 time in total 
Bullet - View user's profile Send private message  
Bullet [ Tue 09 Jan, 2007 22:08 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


SOLVED - Standard Unrelated Gallery In Personal Gallerys

Comments
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Please, try to be more specific with your request... maybe an example will be useful!



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Tue 09 Jan, 2007 22:14 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
I want is so there is a standard sub gallery automatically made in every personal gallery when created..and it will be called Unrelated

Because I have been going into every personal gallery and making a sub gallery called Unrelated LOL



 
Bullet - View user's profile Send private message  
Bullet [ Tue 09 Jan, 2007 22:21 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
I was looking into this for you at MG.com
If some help doesn't arrive before, I will try to find my notes and get back to you.

Thread moved to proper forum: FAP General Discussions And Customizations



 
Artie - View user's profile Send private message  
Artie [ Tue 09 Jan, 2007 22:30 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Thanks Artie!

That would be awesome if you could help me with this!



 
Bullet - View user's profile Send private message  
Bullet [ Tue 09 Jan, 2007 22:32 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Bullet wrote: [View Post]
Thanks Artie!

That would be awesome if you could help me with this!

Yes... Artie is down on it... he will get this done soon... I'm sure...



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 10 Jan, 2007 00:18 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Mod updated 01/30/2007

With a little steering from the man, Mighty, I was able ' Git er done !!! '

Code: [Download] [Hide] [Select]
#
## ------------ [ OPEN ] ----------------
#

album_mod/album_constants.php

#
## ------------ [ FIND ] ----------------
#

?>

#
## ------------ [ BEFORE ADD ] ----------------
#

define('AUTO_CREATE_SUB_CAT_TITLE', 'Unrelated'); // Change title to suit
define('AUTO_CREATE_SUB_CAT_DESCRIPTION', 'Unrelated'); // Change description to suit


#
## ------------ [ OPEN ] ----------------
#

language/lang_english/lang_album_main.php

#
## ------------ [ FIND ] ----------------
#

$lang['No_Personal_Category_admin'] = 'You are not allowed to manage your personal gallery categories';

#
## ------------ [ AFTER ADD ] ----------------
#

$lang['No_Personal_Category_delete'] = 'You are not allowed to delete this personal gallery category';

#
## ------------ [ OPEN ] ----------------
#

album_mod/album_hierarchy_functions.php

#
## ------------ [ FIND ] ----------------
#

'U_CAT_DELETE' => ($is_root && $userdata['user_level'] != ADMIN) ? '' : append_sid(album_append_uid("$admin_url?action=delete&cat_id=$cat_id")),

#
## ------------ [ REPLACE WITH ] ----------------
#

'U_CAT_DELETE' => (($is_root || $cat_title == AUTO_CREATE_SUB_CAT_TITLE) && $userdata['user_level'] != ADMIN) ? '' : append_sid(album_append_uid("$admin_url?action=delete&cat_id=$cat_id")),

#
## ------------ [ FIND ] ----------------
#  
    
'L_DELETE' => ($is_root && $userdata['user_level'] != ADMIN) ? '' : $lang['Delete']

#
## ------------ [ REPLACE WITH ] ----------------
#

'L_DELETE' => (($is_root || $cat_title == AUTO_CREATE_SUB_CAT_TITLE) && $userdata['user_level'] != ADMIN) ? '' : $lang['Delete']
    
    
#
## ------------ [ OPEN ] ----------------
#

album_personal_cat_admin.php

#
## ------------ [ FIND ] ----------------
#

    if( $cat_found == FALSE )
            {
                message_die(GENERAL_ERROR, 'The requested category is not existed');
            }

#
## ------------ [ AFTER ADD ] ----------------
#

// BEGIN protect AUTO_CREATE_SUB_CAT from delete

if( ($thiscat['cat_title'] == AUTO_CREATE_SUB_CAT_TITLE) && ($userdata['user_level'] != ADMIN))
     {
      include_once($phpbb_root_path . 'includes/page_header.'.$phpEx);
            $message = $lang['No_Personal_Category_delete'];
            $message .= "<br /><br />" . sprintf($lang['Click_return_album_index'], '<a href="' . append_sid(album_append_uid('album.' . $phpEx)) . '">', '</a>');
            message_die(GENERAL_MESSAGE, $message);
         }
  
// END protect AUTO_CREATE_SUB_CAT from delete


#
## ------------ [ OPEN ] ----------------
#

album_mod/album_hierarchy_sql.php

#
## ------------ [ FIND ] ----------------
#

    // ------------------------------------------------------------------------
        // insert the personal gallery root category
        // NOTE : the edit and delete level are set to PRIVATE !!
        // ------------------------------------------------------------------------
        $sql = "INSERT INTO ". ALBUM_CAT_TABLE ."
                (cat_title, cat_desc,
                cat_order, cat_view_level,
                cat_upload_level, cat_rate_level,
                cat_comment_level, cat_edit_level,
                cat_delete_level, cat_approval,
                cat_parent, cat_user_id)
                VALUES
                ('" . $root_cat_name . "', '" . $root_cat_name . "',
                '0', '" . $view_level . "',
                '" . $upload_level . "', '0',
                '0', '" . ALBUM_PRIVATE . "',
                '" . ALBUM_PRIVATE . "', '0',
                '0', '$user_id')";

        if(!$result = $db->sql_query($sql))
        {
            //message_die(GENERAL_ERROR, 'Could not create new Personal Root Category', '', __LINE__, __FILE__, $sql);
            return false;
        }

#
## ------------ [ AFTER ADD ] ----------------
#

//  BEGIN CREATE PERSONAL GALLERY SUB CAT
        // Get the main cat id
        $sql = "SELECT cat_id FROM ". ALBUM_CAT_TABLE ."
                     WHERE cat_user_id = ".$user_id."
           LIMIT 1";
                    
            if(!$result = $db->sql_query($sql))
            {
                message_die(GENERAL_ERROR, 'Could not query Album Categories information', '', __LINE__, __FILE__, $sql);
            }
            $row = $db->sql_fetchrow($result);

          $cat_order = 10;
      $cat_parent = $row['cat_id'];
    
            // Here we insert a new row into the db

            $sql = "INSERT INTO ". ALBUM_CAT_TABLE ." (cat_title, cat_desc, cat_order, cat_view_level, cat_upload_level, cat_rate_level, cat_comment_level, cat_edit_level, cat_delete_level, cat_approval, cat_parent, cat_user_id)
                    VALUES ('". AUTO_CREATE_SUB_CAT_TITLE ."', '". AUTO_CREATE_SUB_CAT_DESCRIPTION ."', '$cat_order', '$view_level', '$upload_level', '0', '0', '" . ALBUM_PRIVATE . "', '" . ALBUM_PRIVATE . "', '0', '$cat_parent', '$user_id')";

            if(!$result = $db->sql_query($sql))
            {
                message_die(GENERAL_ERROR, 'Could not create new Album Category', '', __LINE__, __FILE__, $sql);
            }
// END CREATE PERSONAL GALLERY SUB CAT
    
#
## ------------ [ SAVE FILES ] ----------------
# EOM




 
Artie - View user's profile Send private message  
Artie [ Wed 10 Jan, 2007 01:10 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Greaaaaaaat job man!



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 10 Jan, 2007 01:14 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
this is a really cool addition, i was also looking for something like this. The users on my board use their personal gallery as a photography portfolio, and instead of creating a 'Misc' Public gallery, I would rather the users have their own space for unrelated photos to post elsewhere on the forum... that i don't have to personally create :P.



 
krisbfunk - View user's profile Send private message  
krisbfunk [ Wed 10 Jan, 2007 01:26 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Thats awesome!

Thanks guys! This helps alot!

Should be an addon alot of ppl may like!



 
Bullet - View user's profile Send private message  
Bullet [ Wed 10 Jan, 2007 03:45 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
One last request LOL

I made it so my members can add and remove subcats from there personal gallery. Is it possibly that u can add or remove any code so they just cannot remove the Unrelated Gallery?



 
Bullet - View user's profile Send private message  
Bullet [ Wed 10 Jan, 2007 03:51 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
Disregard - See Mod update above

This will still show the Delete link for the sub-cat, but will only link to an unathorized message.


In code you added (above)

FIND (2nd instance of)
Code: [Download] [Hide] [Select]
'" . ALBUM_PRIVATE . "'

REPLACE WITH
Code: [Download] [Hide] [Select]
'1'


OPEN language_album_main.php

FIND
Code: [Download] [Hide] [Select]
$lang['No_Personal_Category_admin'] = 'You are not allowed to manage your personal gallery categories';

AFTER ADD
Code: [Download] [Hide] [Select]
$lang['No_Personal_Category_delete'] = 'You are not allowed to delete this personal gallery category';




OPEN album_personal_cat_admin.php


FIND
Code: [Download] [Hide] [Select]
$sql = "SELECT cat_id, cat_title, cat_order
                    FROM ". ALBUM_CAT_TABLE ."
                    ORDER BY cat_order ASC";

REPLACE WITH
Code: [Download] [Hide] [Select]
$sql = "SELECT cat_id, cat_title, cat_order, cat_delete_level
                    FROM ". ALBUM_CAT_TABLE ."
                    ORDER BY cat_order ASC";


FIND
Code: [Download] [Hide] [Select]
if( $cat_found == FALSE )
            {
                message_die(GENERAL_ERROR, 'The requested category is not existed');
            }

AFTER ADD
Code: [Download] [Hide] [Select]
if( ($thiscat['cat_delete_level'] == 1) && ($userdata['user_level'] != ADMIN))
     {
      include_once($phpbb_root_path . 'includes/page_header.'.$phpEx);
            $message = $lang['No_Personal_Category_delete'];
            $message .= "<br /><br />" . sprintf($lang['Click_return_album_index'], '<a href="' . append_sid(album_append_uid('album.' . $phpEx)) . '">', '</a>');
            message_die(GENERAL_MESSAGE, $message);
         }




 
Artie - View user's profile Send private message  
Artie [ Thu 11 Jan, 2007 21:54 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
awesome! thanks artie



 
krisbfunk - View user's profile Send private message  
krisbfunk [ Fri 12 Jan, 2007 08:32 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
hi.

so this mod worked great, just have a small formatting problem to solve. I'm wondering how to move the subcategory section underneath the main gallery photos. I was able to comment the footer links in album_box.tpl, and assumed I'd be able to change the location of this in album_personal_body.tpl, but have been unable to locate the code to do so.. can someone tell me how to do this? see the image below for where i want it to go.

categoryview_140



 
krisbfunk - View user's profile Send private message  
krisbfunk [ Sun 14 Jan, 2007 00:42 ]
Reply with quote    Download Post  
Post Re: Standard Unrelated Gallery In Personal Gallerys 
 
krisbfunk, the code is in album_cat_body.tpl



 
Artie - View user's profile Send private message  
Artie [ Sun 14 Jan, 2007 03:34 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 3
Goto page 1, 2, 3  Next