News:

Wondering if this will always be free?  See why free is better.

Main Menu

Adding reflections to avatar

Started by iGate, December 22, 2007, 05:06:09 AM

Previous topic - Next topic

iGate

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

karlbenson

Its released under an MIT licence.

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

iGate

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?

iGate

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!

karlbenson

It looks like the turkish user has already made it into a mod.

So i won't need to.

iGate


karlbenson

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,

S3NTYN3L

Quote from: iGate on December 23, 2007, 12:06:00 AM
I DID IT....w00t....

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

How do I get it to "take"?

Bulakbol

In Display.template.php, look for

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

and replace with

<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

S3NTYN3L

Quote from: JohnyB on January 07, 2008, 03:56:50 AM
In Display.template.php, look for

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

and replace with

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

Bulakbol

Do you have the reflection.js in default directory? And also the

<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

S3NTYN3L

Quote from: JohnyB on January 07, 2008, 04:57:22 AM
Do you have the reflection.js in default directory? And also the

<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

Bulakbol

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

S3NTYN3L

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?

Bulakbol

You have to edit this

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

<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

S3NTYN3L

Perfect, thank you!

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

Advertisement: