SOLVED - Standard Unrelated Gallery In Personal Gallerys
SOLVED - Standard Unrelated Gallery In Personal Gallerys
| Comments |
 Re: Standard Unrelated Gallery In Personal Gallerys
|
Please, try to be more specific with your request... maybe an example will be useful! 
|
|
Mighty Gorgon [ Tue 09 Jan, 2007 22:14 ]
|
 |
 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 [ Tue 09 Jan, 2007 22:21 ]
|
 |
 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 [ Tue 09 Jan, 2007 22:30 ]
|
 |
 Re: Standard Unrelated Gallery In Personal Gallerys
|
|
Thanks Artie!
That would be awesome if you could help me with this!
|
|
Bullet [ Tue 09 Jan, 2007 22:32 ]
|
 |
 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... 
|
|
Mighty Gorgon [ Wed 10 Jan, 2007 00:18 ]
|
 |
 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
|
|
Artie [ Wed 10 Jan, 2007 01:10 ]
|
 |
 Re: Standard Unrelated Gallery In Personal Gallerys
|
Greaaaaaaat job man! 
|
|
Mighty Gorgon [ Wed 10 Jan, 2007 01:14 ]
|
 |
 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 [ Wed 10 Jan, 2007 01:26 ]
|
 |
 Re: Standard Unrelated Gallery In Personal Gallerys
|
|
Thats awesome!
Thanks guys! This helps alot!
Should be an addon alot of ppl may like!
|
|
Bullet [ Wed 10 Jan, 2007 03:45 ]
|
 |
 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 [ Wed 10 Jan, 2007 03:51 ]
|
 |
 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);
}
|
|
Artie [ Thu 11 Jan, 2007 21:54 ]
|
 |
 Re: Standard Unrelated Gallery In Personal Gallerys
|
awesome!  thanks artie
|
|
krisbfunk [ Fri 12 Jan, 2007 08:32 ]
|
 |
 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.

|
|
krisbfunk [ Sun 14 Jan, 2007 00:42 ]
|
 |
 Re: Standard Unrelated Gallery In Personal Gallerys
|
|
krisbfunk, the code is in album_cat_body.tpl
|
|
Artie [ Sun 14 Jan, 2007 03:34 ]
|
 |
|
|
Was this topic useful?
Was this topic useful?
|
Page 1 of 3
|
|
|