Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2000
Posts: 64
Member
Member
Offline
Joined: Feb 2000
Posts: 64
Ok the avatar hack is great, but I had a series 5 hacj that allowed people to put the image in under their profile. Sort of had this for 6.0, but there was a problem. I can get ti to sort of work for 6.1, but I have the same problem. When some one does not have an image there is that lovely red x. In 5 this was solved by haveing a 1x1 transparent gif going, but I can not seem to get the code working for 6.1

Could someone take a look at his and tell me what they think.

In public_topic_page.pl find

Code
code:

and above that add:
Code
code:

I have also tried replacing the

Code
code:

with

Code
code:

and it still deos not work

I am using profile field 20 witch is already set up to be an image.

BTW there is also a $this_image line in the right spot to place it under the user name.

[ 10-21-2001: Message edited by: Zedd ]

Sponsored Links
Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
I dont know much code, but you could probally write up an else-if that will replace a blank fiend with the URL to the blank image.

It should look something like this;
---------
if ($user_profile[20] is just "http://")

{
(my $this_img = $vars_config{NonCGIPath}/blank.gif);
}

else

{
(my $this_img = $user_profile[20] wink ;
}
---------

If you can get the right code for the first set of parentheses it should work. smile
If you cant get it to use the exact line, try making one that searches for allowed extention types, like .gif, .jpg, or .bmp

edit. miswrote a line. also noticed the dumb smilies

[ 10-22-2001: Message edited by: Outback2K1 ]

Joined: Aug 2001
Posts: 155
Member
Member
Offline
Joined: Aug 2001
Posts: 155
Well this problem sounds awefully familier... (I tried writing up a hack once where you could use the "Your Pictures" field in your profile to use as an avatar field, but I also always got that lovely red x when nothing was defined.. Didn't know how to do an else if)


I'm not really back. I went away again.
Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
Okay, I found this but I dont know how this would figure in...

----------
function printName(AvatarCheck) {

alert(($user_profile[20] == "http://")?"true":"false");

}
----------

[ 10-22-2001: Message edited by: Outback2K1 ]

Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
Quote
quote:
LOL GTS how come you never told me?

PS. Git ur rear on AIM or MSN...

Sponsored Links
Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
Anyone willing to try this?

---------
if ($user_profile[20] ne 'http://')

{
(my $this_img = $vars_config{NonCGIPath}/blank.gif);
}

else

{
(my $this_img = $user_profile[20] wink ;
}
---------

I'm not sure about the condition, if that'll work or not, but it's worth a shot.

[ 10-22-2001: Message edited by: Outback2K1 ]

Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
*hits self*

You already have most of the code I've been putting, just a bit different...I couldnt read your code very well cuz its so small on my screen.

I think your problem is that

Code
code:

should be

Code
code:

[ 10-22-2001: Message edited by: Outback2K1 ]

Joined: Aug 2001
Posts: 155
Member
Member
Offline
Joined: Aug 2001
Posts: 155
Quote
quote:
I did, remember? :rolleyes:

[ 10-22-2001: Message edited by: GTSDurango ]


I'm not really back. I went away again.
Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
Quote
quote:
Nope....

Joined: Feb 2000
Posts: 64
Member
Member
Offline
Joined: Feb 2000
Posts: 64
I will mess around with it later when I get home.
Thanks for the advice. If I get it to work I will let you know.

Sponsored Links
Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
Almost there!

Now how can I make it check two values and if one or the other is there itll return "ne" false?

[ 10-22-2001: Message edited by: Outback2K1 ]

Joined: Feb 2000
Posts: 64
Member
Member
Offline
Joined: Feb 2000
Posts: 64
damn got it to work!

Code
code:

Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
This should work on 6.0 too smile

Joined: Jun 2001
Posts: 50
Member
Member
Offline
Joined: Jun 2001
Posts: 50
You set it into a loop by using $this_img twice...

I did a lil work and got the extra line to totally disappear if the person doesnt have an avatar defined.
Also, when you specify the image size, it stretches images to 100x100, so unless theres a way to do a maiximum size and it'll keep the aspect ratio, i suggest people leave that bit out.

edit. it keeps bein screwed up, and the UBB seems to be cacheing the variable names and even if i clear the cache it doesnt clear it up....i have the code but im gonna test it first and post a demo thread...

[ 10-23-2001: Message edited by: Outback2K1 ]

Joined: Feb 2000
Posts: 64
Member
Member
Offline
Joined: Feb 2000
Posts: 64
not sure what you mean by putting it in a loop. It works and does not slow the board down or anything. So is this a problem?

the extra space comes from haveing the 1x1 gif there. I dod not have anything under where that images is show, so it is not a problem.

As for the 100 by 100. It is generally used to shrink images if people are using one too large. I suggest in the profile text that people use an image that is already 100 by 100 that way the sizing will not mess it up.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)