Advanced search  

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]

Pages: [1]   Go Down

Author Topic: comments images and smilies in theme folder  (Read 15788 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
comments images and smilies in theme folder
« 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.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: comments images and smilies in theme folder
« Reply #1 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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: comments images and smilies in theme folder
« Reply #2 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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: comments images and smilies in theme folder
« Reply #3 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.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: comments images and smilies in theme folder
« Reply #4 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.
« Last Edit: December 12, 2013, 02:20:32 pm by Αndré »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: comments images and smilies in theme folder
« Reply #5 on: November 06, 2013, 09:50:15 pm »

thanks...100thanks.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: comments images and smilies in theme folder
« Reply #7 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.
« Last Edit: December 12, 2013, 03:05:26 pm by Αndré »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: comments images and smilies in theme folder
« Reply #8 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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: comments images and smilies in theme folder
« Reply #9 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: comments images and smilies in theme folder
« Reply #10 on: December 16, 2013, 02:45:22 pm »

Have you already applied the fix of SVN revision 8624?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: comments images and smilies in theme folder
« Reply #11 on: December 16, 2013, 02:50:58 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: comments images and smilies in theme folder
« Reply #12 on: December 16, 2013, 03:01:01 pm »

Just apply those changes to include/smiles.inc.php.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: comments images and smilies in theme folder
« Reply #13 on: December 16, 2013, 03:15:42 pm »

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

working.thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.035 seconds with 20 queries.