Support > cpg1.5 themes (visuals)
[url]Album name[/url] under lastalb thumb
3git:
Hello,
At first I'd like to thank all Devs for great work around CPG. I'm using it for 3-4 years now (1.4x) and now I'm moving to 1.5x.
My problem is a long term issue I have. Never asked for help here because it wasn't so urgent and besides that I like founding things by myself (as possible of course). Now, when I decided to move to 1.5x with EnlargeIt plugin I started to drill the problem again.
So the problem is to have album name as a link to the album under the thumbnail in lastabl table. Before Enlargeit people used to click on thumb to get to the newest album thumb view. Now, when you click on thumb you get full sized pic without redirection. I don't want people to search the newest album in the categories, because it can be kind confusing after few years of just clicking on thumb. I was concidering to ask about enlargeit help, to disable it on main page, but as the problem is more on lastalb side I'd like to solve it that way (I needed to put some extra info under thumbs, especially lastalb panel and never accomplished).
What I tried:
-search the forum to solve my problem many times with various search queries
-mess with sample/theme.php, template.html
-mess with igames/theme.php, template.html <- my theme
-mess with includes/functions.php <- I think that's the one, but never did what I want, maybe my php knowledge is too poor.
-mess with includes/theme.inc.php
The other day I've found how to put some extra fields under thumbs in thumbview or lasthits (I found post how to remove IP from lasthits and tried to do the same (add) on lastabl but with no result). About lastalb I found various posts, but mostly about sorting etc, not my problem.
My old gallery 1.4x -> www.3git.org (polish site)
My new gallery 1.5x -> caiman.net.pl (as well polish, don't mind header from 3git, I'll mess the layout at the end)
Any ideas welcome, if you just point me what to do I'll be glad as well.
Αndré:
--- Quote from: 3git on May 09, 2010, 03:08:24 pm ---when you click on thumb you get full sized pic
--- End quote ---
Does it happen when you disable EnlargeIt!, too?
3git:
No, it does not. That's why I'd like to have album name as a link below thumb, so people can jump into new album instead of searching it in cats.
3git:
I think I got it working...
I changed in includes/functions.php
--- Code: ---global $thumb; // make $thumb accessible to plugins
foreach($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
if (in_array($aid, $album_types['albums'])) {
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => $thumb['admin_menu'],
);
} else {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) { // code for full-size pop-up
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
$target = 'javascript:;" onclick="alert(\''.sprintf($lang_errors['login_needed'],'','','','').'\');';
} elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
$target = 'javascript:;" onclick="alert(\''.sprintf($lang_errors['access_intermediate_only'],'','','','').'\');';
} else {
$target = 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int)$thumb['pwidth']+(int)$CONFIG['fullsize_padding_x']) . ',height=' . ((int)$thumb['pheight']+(int)$CONFIG['fullsize_padding_y']). '\');';
}
} elseif ($aid == 'random') {
$target = "displayimage.php?pid={$thumb['pid']}$uid_link#top_display_media";
} elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
$page = cpg_get_comment_page_number($thumb['msg_id']);
$page = (is_numeric($page)) ? "&page=$page" : '';
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link&msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}";
} else {
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link#top_display_media";
}
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => $target,
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => $thumb['admin_menu'],
);
}
} else { // mode != 'thumb'
// Used for mode = 'user' from list_users() in index.php
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => '',
);
}
--- End code ---
to:
--- Code: --- global $thumb; // make $thumb accessible to plugins
foreach($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
if (in_array($aid, $album_types['albums'])) {
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => $thumb['admin_menu'],
'{ALBUM_NAM}' => $thumb['title'], /HERE++++++++++++++++++++
);
} else {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) { // code for full-size pop-up
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
$target = 'javascript:;" onclick="alert(\''.sprintf($lang_errors['login_needed'],'','','','').'\');';
} elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
$target = 'javascript:;" onclick="alert(\''.sprintf($lang_errors['access_intermediate_only'],'','','','').'\');';
} else {
$target = 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int)$thumb['pwidth']+(int)$CONFIG['fullsize_padding_x']) . ',height=' . ((int)$thumb['pheight']+(int)$CONFIG['fullsize_padding_y']). '\');';
}
} elseif ($aid == 'random') {
$target = "displayimage.php?pid={$thumb['pid']}$uid_link#top_display_media";
} elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
$page = cpg_get_comment_page_number($thumb['msg_id']);
$page = (is_numeric($page)) ? "&page=$page" : '';
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link&msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}";
} else {
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link#top_display_media";
}
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => $target,
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => $thumb['admin_menu'],
'{ALBUM_NAM}' => $thumb['title'], /HERE++++++++++++++++++++
);
}
} else { // mode != 'thumb'
// Used for mode = 'user' from list_users() in index.php
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => '',
'{ALBUM_NAM}' => $thumb['title'], /HERE++++++++++++++++++++
);
}
--- End code ---
and then in same file:
--- Code: ---<!-- BEGIN thumb_cell -->
<td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a href="{LINK_TGT}">{THUMB}<br /></a>
{CAPTION}
{ADMIN_MENU}
</td>
</tr>
</table>
</td>
<!-- END thumb_cell -->
--- End code ---
to:
--- Code: ---<!-- BEGIN thumb_cell -->
<td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a href="{LINK_TGT}">{THUMB}<br /></a>
[b]<a href="{LINK_TGT}">{ALBUM_NAM}<br /></a>[/b] /HERE++++++++++++++++++++
{CAPTION}
{ADMIN_MENU}
</td>
</tr>
</table>
</td>
<!-- END thumb_cell -->
--- End code ---
NOW, it only works for LASTALB (in LASTHITS remains blank space <- any idea?)
To work it out with EnlargeIt I changed this:
plugins/enlargeit/codebase.php
--- Code: ---<!-- BEGIN thumb_cell -->
<td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a {LINK_ONCLICK} href="{LINK_TGT}">{THUMB}<br /></a>
{CAPTION}
{ADMIN_MENU}
</td>
</tr>
</table>
</td>
<!-- END thumb_cell -->
--- End code ---
to
--- Code: ---<!-- BEGIN thumb_cell -->
<td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a {LINK_ONCLICK} href="{LINK_TGT}">{THUMB}<br /></a>
<a href="{LINK_TGT}">{ALBUM_NAM}<br /></a> /HERE++++++++++++++++++++
{CAPTION}
{ADMIN_MENU}
</td>
</tr>
</table>
</td>
<!-- END thumb_cell -->
--- End code ---
Now I need to get rid of album name from {CAPTION} and make it work on lasthits (but I don't mind it's not there)
3git:
Sorry for so many posts (can edit?)
FIRSTLY - the file to edit in previous post is themes.inc.php NOT includes/functions.php (too many windows open, my bad)
Secondly, to kick out title from {CAPTION} I edited:
includes/functions.php (for sure this time)
--- Code: ---function build_caption(&$rowset, $must_have = array(), $mode = 'files')
{
global $CONFIG, $THEME_DIR, $lang_date, $lang_get_pic_data, $cpg_udb;
foreach ($rowset as $key => $row) {
$caption = '';
if ($CONFIG['display_filename']) {
$caption .= '<span class="thumb_filename">' . $row['filename'] . '</span>';
}
if (!empty($row['title'])) {
$caption .= '<span class="thumb_title">' . $row['title'] . '</span>';
}
--- End code ---
to
--- Code: ---function build_caption(&$rowset, $must_have = array(), $mode = 'files')
{
global $CONFIG, $THEME_DIR, $lang_date, $lang_get_pic_data, $cpg_udb;
foreach ($rowset as $key => $row) {
$caption = '';
if ($CONFIG['display_filename']) {
$caption .= '<span class="thumb_filename">' . $row['filename'] . '</span>';
}
if (!empty($row['title'])) {
$caption .= '<span class="thumb_title"></span>'; /HERE+++++++++++++++++
}
--- End code ---
If any one can help with fixing lasthits I'd be glad. I mean now it does not show title of the album linked to it's thumbview.
Navigation
[0] Message Index
[#] Next page
Go to full version