forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on October 16, 2013, 10:07:09 am
-
I want the theme to show the comments images (comment_disapprove.png etc) and smilies from the theme folder.
I made a img_comments folder in the theme folder.
-
Is that a question or a statement? Please try and be detailed as I really am not quite sure what you are asking for.
-
a request - how to
the comments have images like comment_disapprove.png,comment_approve_disabled.png,edit.png and delete.png.
the images are in images/icons folder.
the comments smilies are in images/smiles folder.
I want my theme to load the images and smilies from mytheme/images/icons folder and mytheme/images/smiles.
IMPORTANT:
I want to write somthing in my theme.php not to edit coppermine files.
-
I did made it to make my theme load the ratings stars from my theme folder.
I just typed at the top of my theme.php :
define('THEME_HAS_RATING_GRAPHICS', 1);
before coppermine credits.
I would like to do the same for the comments but I do not know how.
-
Copy the function theme_html_comments from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist.
Regarding the comment approval / edit / delete / report icons, find
cpg_fetch_icon('comment_disapprove_disabled', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_disapprove_disabled', 0))
find
cpg_fetch_icon('comment_approve', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_approve', 0))
find
cpg_fetch_icon('comment_disapprove', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_disapprove', 0))
find
cpg_fetch_icon('comment_approve_disabled', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_approve_disabled', 0))
find
cpg_fetch_icon('comment_approval', 0, $lang_display_comments['pending_approval'])
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_approval', 0, $lang_display_comments['pending_approval'])
find
cpg_fetch_icon('delete', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('delete', 0))
find
cpg_fetch_icon('edit', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('edit', 0))
find
cpg_fetch_icon('report', 0)
and replace with
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('report', 0))
Regarding the smilies, find
$smilies = generate_smilies("f{$row['msg_id']}", 'msg_body');
and replace with
$params['{SMILIES}'] = str_replace('src="', 'src="themes/my_theme/', generate_smilies("f{$row['msg_id']}", 'msg_body'));
find
$params['{SMILIES}'] = generate_smilies();
and replace with
$params['{SMILIES}'] = str_replace('src="', 'src="themes/my_theme/', generate_smilies());
It's maybe a good idea to add constants for both tasks like it has been already done for other icons. I'll check if we can do this even in cpg1.5.x.
-
thanks...100thanks.
-
Note to myself.
Add constants THEME_HAS_COMMENT_GRAPHICS and THEME_HAS_SMILEY_GRAPHICS to code and docs:
- http://documentation.coppermine-gallery.net/en/dev_vars.htm#vars_constants_constants
- http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_php_list
- http://documentation.coppermine-gallery.net/en/theme_graphics.htm
-
While implementing the smiley code I recognized that we don't need to customize the code that way nor add the THEME_HAS_SMILEY_GRAPHICS constant. Coppermine already checks the theme directory for smiley images:
$paths = array($THEME_DIR.'/smiles/', 'images/smiles/');
$smile_path = (file_exists($paths[0].$smiley[1]))?($paths[0]):($paths[1]);
Unfortunately the variable $smile_path isn't used, but there's hard-coded
images/smiles/
instead. I'll fix that soon. Fixed in SVN revision 8624.
This means the following for site admins. Just create a directory "smiles" in your theme folder (e.g. /your_theme/smiles/) and Coppermine will automatically use images from that folder for configured smileys. That feature seems to be undocumented yet.
-
Added possibility to use theme-depended images for approve/disapprove/delete/edit/report comments in SVN revision 8625.
-
I have a folder smiles in the theme folder (curve_masonry/smiles/lol.gif) but the theme loads the images from images/smiles/lol.gif
the folder has all the coppermine default smiles - I changed only 4 smiles with other images.
live url - http://www.allvip.us/cpg/test/displayimage.php?pid=18#top_display_media
-
Have you already applied the fix of SVN revision 8624?
-
no.I will read the docs about how to apply a SVN.
thanks.
-
Just apply those changes (https://sourceforge.net/p/coppermine/code/8624/tree/trunk/cpg1.5.x/include/smilies.inc.php?diff=50bef282e88f3d0c029d306d:8623) to include/smiles.inc.php.
-
ok.I replaced the lines that have a - with the lines that have a +
working.thanks.