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

Title: comments images and smilies in theme folder
Post 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.
Title: Re: comments images and smilies in theme folder
Post by: Phill Luckhurst on October 16, 2013, 10:58:24 am
Is that a question or a statement? Please try and be detailed as I really am not quite sure what you are asking for.
Title: Re: comments images and smilies in theme folder
Post by: allvip on October 16, 2013, 11:43:45 am
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.
Title: Re: comments images and smilies in theme folder
Post by: allvip on October 16, 2013, 11:51:12 am
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 :

Code: [Select]
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.

Title: Re: comments images and smilies in theme folder
Post by: Αndré on November 06, 2013, 02:11:24 pm
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
Code: [Select]
cpg_fetch_icon('comment_disapprove_disabled', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_disapprove_disabled', 0))
find
Code: [Select]
cpg_fetch_icon('comment_approve', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_approve', 0))
find
Code: [Select]
cpg_fetch_icon('comment_disapprove', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_disapprove', 0))
find
Code: [Select]
cpg_fetch_icon('comment_approve_disabled', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_approve_disabled', 0))
find
Code: [Select]
cpg_fetch_icon('comment_approval', 0, $lang_display_comments['pending_approval'])and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('comment_approval', 0, $lang_display_comments['pending_approval'])
find
Code: [Select]
cpg_fetch_icon('delete', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('delete', 0))
find
Code: [Select]
cpg_fetch_icon('edit', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('edit', 0))
find
Code: [Select]
cpg_fetch_icon('report', 0)and replace with
Code: [Select]
str_replace('src="', 'src="themes/my_theme/', cpg_fetch_icon('report', 0))

Regarding the smilies, find
Code: [Select]
$smilies = generate_smilies("f{$row['msg_id']}", 'msg_body');and replace with
Code: [Select]
$params['{SMILIES}'] = str_replace('src="', 'src="themes/my_theme/', generate_smilies("f{$row['msg_id']}", 'msg_body'));
find
Code: [Select]
$params['{SMILIES}'] = generate_smilies();and replace with
Code: [Select]
$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.
Title: Re: comments images and smilies in theme folder
Post by: allvip on November 06, 2013, 09:50:15 pm
thanks...100thanks.
Title: Re: comments images and smilies in theme folder
Post by: Αndré on November 28, 2013, 04:07:19 pm
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
Title: Re: comments images and smilies in theme folder
Post by: Αndré on December 12, 2013, 02:45:34 pm
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:
Code: [Select]
$paths = array($THEME_DIR.'/smiles/', 'images/smiles/');
Code: [Select]
$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
Code: [Select]
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.
Title: Re: comments images and smilies in theme folder
Post by: Αndré on December 12, 2013, 04:06:09 pm
Added possibility to use theme-depended images for approve/disapprove/delete/edit/report comments in SVN revision 8625.
Title: Re: comments images and smilies in theme folder
Post by: allvip on December 16, 2013, 02:44:14 pm
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
Title: Re: comments images and smilies in theme folder
Post by: Αndré on December 16, 2013, 02:45:22 pm
Have you already applied the fix of SVN revision 8624?
Title: Re: comments images and smilies in theme folder
Post by: allvip on December 16, 2013, 02:50:58 pm
no.I will read the docs about how to apply a SVN.
thanks.
Title: Re: comments images and smilies in theme folder
Post by: Αndré on December 16, 2013, 03:01:01 pm
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.
Title: Re: comments images and smilies in theme folder
Post by: allvip on December 16, 2013, 03:15:42 pm
ok.I replaced the lines that have a - with the lines that have a +

working.thanks.