Topic: sharing avitar directory

Hi All.

I have installed two forums on different but simmilar sites, sharing one database.
Works fine apart from the avitars.

I need to get both forums saving avitars into, and reading avitars from, one directory - but cant.

I have tried the following:
Specifying full path in PunBB Administrator > Options to same directory for both forums, rather than "relative to the PunBB root directory" - does not work...
Also setting permissions on directory to 777

Any help would be ace,
Thanks.

Re: sharing avitar directory

Try using ../ and such to make the path relative?

Re: sharing avitar directory

each forum is installed at a different domain - am not sure how I would use ../ to make the path name relative?

Re: sharing avitar directory

Well, like this

forum A is installed in /home/apache/site/forum/
forun B is installed in /home/apache/site2/forum/

You want to use the avatar folder in forum2 for forum
You would use ../../site2/forum/img/avatars/ (I can't remember if you should use a trailing slash) for forum A

Re: sharing avitar directory

But if the directory is the same for both forums, what would happen when ID5 from one forum tries to upload an avatar, overwriting ID5 from the other forum?

Indocron
$theQuestion = (2*b) || !(2*b);

Re: sharing avitar directory

Mmm, good point :-/

7 (edited by doctorscream 2005-03-18 07:10)

Re: sharing avitar directory

Is there a hack to get punBB to add a prefix to the avatar file name?

ie:
forum#1 writes files as a1.jpg, a2jpg, a3jpg
forum#2 writes files as b1.jpg, b2jpg, b3jpg

and then the previous soultion might work...

Re: sharing avitar directory

wait, just make both forums use a different avatars dir

Re: sharing avitar directory

Thanks for your reply Connorhd,

But that would not suit my needs, as the two forums to share avitas - they are on sites with simmilar content (just different masthead and domain names - client request...) but sharing a forum database...

At the moment you can log in to either sites forum (with shareed db) as one user - and in the site that you registered with you can see your avitar, but on the site that you did not register with you can not see your avitar.

Re: sharing avitar directory

so they both share the same users table? if so then the ids won't clash

11 (edited by doctorscream 2005-03-18 09:17)

Re: sharing avitar directory

Thanks again Connorhd,

Both forums are now writing to the corect shared directory.

forum a writes to: img/avatars
forum b writes to: ../../../../site_a/www/www/forum/img/avatars

This has presented a new issue -

forum a reads from: http://domain_a/forum/img/avatars/3.jpg
forum b reads from: http://domain_b/site_a/www/www/forum/img/avatars (therefore broken img link)


How do I change forum b so that it reads from ../../../../site_a/www/www/forum/img/avatars ?


Thanks!

Re: sharing avitar directory

Manually change places that display from using $pun_config['o_avatars_dir']

Re: sharing avitar directory

Thanks for that Smartys,

Sounds like something I would like to try.

What files do I need to change $pun_config['o_avatars_dir']
and what would I change it to?

Thanks.

Re: sharing avitar directory

Well, where-ever avatars are displayed tongue
So, when they're displayed (not uploaded) on profile.php
viewtopic.php as well

15 (edited by doctorscream 2005-03-18 19:37)

Re: sharing avitar directory

Thankyou for your help Smartys,
I am new to php and am very stuck on this friday night... ('cause it dont work!)

Snippet from avitar section of profile.php code, with new path to shared avatar directory added:

                    <fieldset id="profileavatar">
                        <legend><?php echo $lang_profile['Avatar legend'] ?></legend>
                        <div class="infldset">
<?php if (isset($avatar_format)): ?>                    <img src="<?php echo $pun_config['http://www.shared-avatar-directory-domain.com/img/avatars'].'/'.$id.'.'.$avatar_format ?>" <?php echo $img_size[3] ?> alt="" />
<?php endif; ?>                    <p><?php echo $lang_profile['Avatar info'] ?></p>

Thanks mate!

Re: sharing avitar directory

lol, you replace the whole $pun_config bit (it shouldn't be there) wink

Re: sharing avitar directory

Thankyou very much for your help! Will try it tomorrow and let you know as am now close to the bottom of a bottle of red wine.
big_smile

Re: sharing avitar directory

programming + red wine = interesting results

19 (edited by doctorscream 2005-03-18 21:51)

Re: sharing avitar directory

bahhhha!
programming + red wine = parse errors

can some one please put me out of my misery!



what do I put in here?...

<img src="<?php echo $pun_config['o_avatars_dir'].'/'.$id.'.'.$avatar_format ?>"

beacuse

<img src="<?php echo http://www.shared-avatar-dir-domain.com/img/avatars.'/'.$id.'.'.$avatar_format ?>"

and all my other random drunken combinations dont work.

<strong>bugger.</strong>

Re: sharing avitar directory

sobered up and sorted it out - works a treat - thanks all!

big_smile big_smile big_smile big_smile

PunBB.org rocks.