|
Page 1 of 3
|
Bullet
Joined: January 2007
Posts: 34
|
 FAP CUSTOMIZATION - 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 |
#1 Tue 09 Jan, 2007 22:08 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Mighty Gorgon 
Luca Libralato
Joined: August 2006
Posts: 7192
Location:  Borgo San Michele
|
 Re: Standard Unrelated Gallery In Personal Gallerys
Please, try to be more specific with your request... maybe an example will be useful!
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#2 Tue 09 Jan, 2007 22:14 |
|
Bullet
Joined: January 2007
Posts: 34
|
 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
|
#3 Tue 09 Jan, 2007 22:21 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 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
|
#4 Tue 09 Jan, 2007 22:30 |
|
Bullet
Joined: January 2007
Posts: 34
|
 Re: Standard Unrelated Gallery In Personal Gallerys
Thanks Artie!
That would be awesome if you could help me with this!
|
#5 Tue 09 Jan, 2007 22:32 |
|
Mighty Gorgon 
Luca Libralato
Joined: August 2006
Posts: 7192
Location:  Borgo San Michele
|
 Re: Standard Unrelated Gallery In Personal Gallerys
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...
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#6 Wed 10 Jan, 2007 00:18 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 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 !!! '
#
## ------------ [ 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
|
#7 Wed 10 Jan, 2007 01:10 |
|
Mighty Gorgon 
Luca Libralato
Joined: August 2006
Posts: 7192
Location:  Borgo San Michele
|
 Re: Standard Unrelated Gallery In Personal Gallerys
Greaaaaaaat job man!
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#8 Wed 10 Jan, 2007 01:14 |
|
krisbfunk 
Joined: December 2006
Posts: 95
Location:
|
 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.
|
#9 Wed 10 Jan, 2007 01:26 |
|
Bullet
Joined: January 2007
Posts: 34
|
 Re: Standard Unrelated Gallery In Personal Gallerys
Thats awesome!
Thanks guys! This helps alot!
Should be an addon alot of ppl may like!
|
#10 Wed 10 Jan, 2007 03:45 |
|
Bullet
Joined: January 2007
Posts: 34
|
 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?
|
#11 Wed 10 Jan, 2007 03:51 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 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)
REPLACE WITH
OPEN language_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_personal_cat_admin.php
FIND
$sql = "SELECT cat_id, cat_title, cat_order
FROM ". ALBUM_CAT_TABLE ."
ORDER BY cat_order ASC";
REPLACE WITH
$sql = "SELECT cat_id, cat_title, cat_order, cat_delete_level
FROM ". ALBUM_CAT_TABLE ."
ORDER BY cat_order ASC";
FIND
if( $cat_found == FALSE )
{
message_die(GENERAL_ERROR, 'The requested category is not existed');
}
AFTER ADD
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);
}
|
#12 Thu 11 Jan, 2007 21:54 |
|
krisbfunk 
Joined: December 2006
Posts: 95
Location:
|
 Re: Standard Unrelated Gallery In Personal Gallerys
awesome!  thanks artie
|
#13 Fri 12 Jan, 2007 08:32 |
|
krisbfunk 
Joined: December 2006
Posts: 95
Location:
|
 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.
|
#14 Sun 14 Jan, 2007 00:42 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Standard Unrelated Gallery In Personal Gallerys
krisbfunk, the code is in album_cat_body.tpl
|
#15 Sun 14 Jan, 2007 03:34 |
|
|
Page 1 of 3
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|