Advertisement:

Author Topic: Adding reflections to avatar  (Read 5718 times)

Offline iGate

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • International Honor Forces
Adding reflections to avatar
« on: December 22, 2007, 05:06:09 AM »
If you would like to do this see here.



Original Message
hi all.

i came across this forum
(i have linked to a random thread. so that you may see the reflection effect in the avatars) and i fell in love with the way they did the reflection of images. With a little poking around and a google search i found the code they used came from here.

My question, which will hopefully benefit others, is how do i create such an effect, for the avatars, on my smf 1.1.4 forum. i assume i would have to edit Display.php? and other files which deal with the avatar. im not sure at all.

Here are some links that might be handy:
Add reflection to IPB mod

Edits to phpbb 2 : http://cow.neondragon.net/index.php/1025-Reflectionjs-Version-15#comment1050

it seems like a simple edit: just download the file. upload two javascripts and insert 4 words where required.

anyhelp would be appreciated.
Even if you can't help. if you can tell me what files i need to editt i would appreciate that too.

iGate
« Last Edit: December 23, 2007, 12:08:04 AM by iGate »

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: Adding reflections to some images.
« Reply #1 on: December 22, 2007, 06:06:15 AM »
Its released under an MIT licence.

So I'll look at maybe making an integration mod for it.

Offline iGate

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • International Honor Forces
Re: Adding reflections to some images.
« Reply #2 on: December 22, 2007, 08:59:24 PM »
i found this:

http://www.simplemachines.org/community/index.php?topic=151184

the work's already been done i see. but it is a little hard for english users. any1 understand turkish?

Offline iGate

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • International Honor Forces
Re: Adding reflections to some images.
« Reply #3 on: December 23, 2007, 12:06:00 AM »
I DID IT....w00t....

okay. if anyone else is interested here is how to do it. NOTE: I merely translated into english the
work of KuDЯéT

Here is how to do it:

1. Visit this page and go to: Download Latest Version or similar. (at time of writing it is v1.7)
2. Open your ftp client and go to the ~/Themes/Default/
3. Make a backup copy of Display.template.php
4. Open the Display.template.php
5.
Code: (Find) [Select]
// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';

6.
Code: ( Replace with) [Select]
// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;"><img src="' . $message['member']['avatar']['href'] . '" class="reflect"  title="Avatar" border="0" /></div><br />';

7.
Code: (Find) [Select]
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script>

8.
Code: (Add After) [Select]
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/reflection.js"></script>

If this is made into a package. Awesome. I think it shouldn't be too hard now that you know the above. Maybe i will try it!

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: Adding reflections to avatar
« Reply #4 on: December 23, 2007, 04:53:27 AM »
It looks like the turkish user has already made it into a mod.

So i won't need to.

Offline iGate

  • Jr. Member
  • **
  • Posts: 159
  • Gender: Male
    • International Honor Forces
Re: Adding reflections to avatar
« Reply #5 on: December 24, 2007, 12:30:45 AM »
he did?  okay?

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: Adding reflections to avatar
« Reply #6 on: December 24, 2007, 04:07:21 AM »
He did, just below the screenshot in the topic
http://www.simplemachines.org/community/index.php?topic=151184

Look for Default =>  burdan

Burdan is your download link to the mod,

Offline S3NTYN3L

  • Jr. Member
  • **
  • Posts: 192
  • Gender: Male
  • Oderint Dum Metuant
Re: Adding reflections to avatar
« Reply #7 on: January 06, 2008, 07:25:48 AM »
I DID IT....w00t....

<snip>
This isn't working for me...

How do I get it to "take"?

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Adding reflections to avatar
« Reply #8 on: January 07, 2008, 03:56:50 AM »
In Display.template.php, look for

Code: [Select]
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
and replace with

Code: [Select]
<div style="overflow: auto; width: 100%;"><img src="', $message['member']['avatar']['href'], '" class="reflect rheight30" alt="" /></div><br />';

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline S3NTYN3L

  • Jr. Member
  • **
  • Posts: 192
  • Gender: Male
  • Oderint Dum Metuant
Re: Adding reflections to avatar
« Reply #9 on: January 07, 2008, 04:40:57 AM »
In Display.template.php, look for

Code: [Select]
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
and replace with

Code: [Select]
<div style="overflow: auto; width: 100%;"><img src="', $message['member']['avatar']['href'], '" class="reflect rheight30" alt="" /></div><br />';



Still doesn't work, even after restarting browser and clearing cache...

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Adding reflections to avatar
« Reply #10 on: January 07, 2008, 04:57:22 AM »
Do you have the reflection.js in default directory? And also the

Code: [Select]
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/reflection.js"></script>

in your Display.template.php?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline S3NTYN3L

  • Jr. Member
  • **
  • Posts: 192
  • Gender: Male
  • Oderint Dum Metuant
Re: Adding reflections to avatar
« Reply #11 on: January 07, 2008, 06:25:03 AM »
Do you have the reflection.js in default directory? And also the

Code: [Select]
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/reflection.js"></script>

in your Display.template.php?

I'm not using the default theme...
I'm using a customized version of it, however...

I went into the package-info and modification files and edited the installation paths to point to the files used my my theme...

Yes, the .js is in the theme directory and that code is in place...

Here are the files I'm using...

http://h1.ripway.com/s3ntyn3l/reflection.zip

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Adding reflections to avatar
« Reply #12 on: January 07, 2008, 06:35:18 AM »
The mod that you installed stored the reflection.js in Themes/s3ntyn3ldark directory. Move the reflection.js to Themes/default directory and see if it will work.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline S3NTYN3L

  • Jr. Member
  • **
  • Posts: 192
  • Gender: Male
  • Oderint Dum Metuant
Re: Adding reflections to avatar
« Reply #13 on: January 07, 2008, 06:43:09 AM »
That seems to correct this issue...

However, I do not want the file stored in the default theme directory, I want it stored in the s3ntyn3ldark directory...

What do I change to get it working from in that directory?

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Adding reflections to avatar
« Reply #14 on: January 07, 2008, 06:54:12 AM »
You have to edit this

Code: [Select]
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/reflection.js"></script>to this

Code: [Select]
<script language="JavaScript" type="text/javascript" src="' . $GLOBALS['boardurl'], '/Themes/s3ntyn3ldark/reflection.js"></script>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline S3NTYN3L

  • Jr. Member
  • **
  • Posts: 192
  • Gender: Male
  • Oderint Dum Metuant
Re: Adding reflections to avatar
« Reply #15 on: January 07, 2008, 07:01:52 AM »
Perfect, thank you!

Now, if only it didn't tune animated avatar reflections blue...