How to add the NoFollow tag only for the links of the film strip pics?
Regards.
You need to come up with a custom function for theme_display_film_strip. Edit themes/yourtheme/theme.php with a plain text editor and find that function. If it exists, edit as suggested below. If that function diesn't exist in your custom theme, copy// Added to display film_strip
function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb')
{
global $CONFIG, $THEME_DIR;
global $template_film_strip, $lang_film_strip;
static $template = '';
static $thumb_cell = '';
static $empty_cell = '';
static $spacer = '';
if ((!$template)) {
$template = $template_film_strip;
$thumb_cell = template_extract_block($template, 'thumb_cell');
$empty_cell = template_extract_block($template, 'empty_cell');
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$uid_link = (isset($_GET['uid']) && is_numeric($_GET['uid'])) ? '&uid=' . $_GET['uid'] : '';
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['max_film_strip_items']) . '%';
$i = 0;
$thumb_strip = '';
foreach($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
$params = array('{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => ''
);
} else {
$params = array('{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => '',
'{ADMIN_MENU}' => ''
);
}
$thumb_strip .= template_eval($thumb_cell, $params);
}
if (defined('THEME_HAS_FILM_STRIP_GRAPHICS')) {
$tile1 = $THEME_DIR . 'images/tile1.gif';
$tile2 = $THEME_DIR . 'images/tile2.gif';
} elseif (defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
$tile1=$tile2=$THEME_DIR . 'images/tile.gif';
} else {
$tile1=$tile2= 'images/tile.gif';
}
$params = array('{THUMB_STRIP}' => $thumb_strip,
'{COLS}' => $i,
'{TILE1}' => $tile1,
'{TILE2}' => $tile2,
);
ob_start();
starttable($CONFIG['picture_table_width']);
echo template_eval($template, $params);
endtable();
$film_strip = ob_get_contents();
ob_end_clean();
return $film_strip;
}
from themes/sample/theme.php into a new line before?>
of the file themes/yourtheme/theme.php
The edit you need to perform is:
find '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link",
and replace with '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link" . '" rel="nofollow',
Then find '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
and replace with '{LINK_TGT}' => "index.php?cat={$thumb['cat']}" . '" rel="nofollow',
Haven't tested (just came up with the code out of the back of my head), but should work that way - please report. The nesting of single and double quotes that seems to be wrong is intended, please use exactly as I suggested.
In the future, respect board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.0.html) when asking questions: we want to you always post a link to your gallery when asking for support. Additionally, when asking for support on themeing, it's a good idea to zip your custom theme folder and attach the theme to your posting.
Your hack worked very well.
Thank you very much.
But I'm afraid I'll need your help again (http://forum.coppermine-gallery.net/index.php/topic,61314.0.html) :)
And I can't post the link of my website here due to it's adult content. Sorry!
We have a strict "one issue per thread" that you agreed to respect when signing up. Locking.