comments images and smilies in theme folder comments images and smilies in theme folder
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

comments images and smilies in theme folder

Started by allvip, October 16, 2013, 10:07:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

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.

phill104

Is that a question or a statement? Please try and be detailed as I really am not quite sure what you are asking for.
It is a mistake to think you can solve any major problems just with potatoes.

allvip

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.

allvip

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.


Αndré

#4
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.

allvip



Αndré

#7
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.

Αndré

Added possibility to use theme-depended images for approve/disapprove/delete/edit/report comments in SVN revision 8625.

allvip

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

Αndré

Have you already applied the fix of SVN revision 8624?

allvip

no.I will read the docs about how to apply a SVN.
thanks.

Αndré


allvip

ok.I replaced the lines that have a - with the lines that have a +

working.thanks.