Previous Thread
Next Thread
Print Thread
Hop To
#222452 02/16/2009 12:27 AM
Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
I am putting together a regional geocaching forum, and i would like to allow my users to show their geocaching.com stats image in their signatures. A typical image is like this (mine):

http://img.geocaching.com/stats/img...uid=8386c231-1288-4c0f-93ae-0accf136bd15

The default behavior of ubbthreads is to disallow images without an image extension. In a similar request made by someone else here back in October, Rick said:

Quote
I'll have to put in an option. Right now it checks to see if the image is being generated by a script as a security precaution.

If you're comfortable with regex, it's blocked on line 639 of libs/bbcode.inc.php.

I'm not particularly comfortable with regular expressions, but that code currently reads:

Code
	function handle_img($url, $align="", $bypass_filter = false) {
		if ($this->total_images >= $this->image_limit || (!$bypass_filter && !preg_match('#^[^\[\'"\]]+?\.(gif|png|jpg|jpeg)$#i', $url))) {
			if ($align != "") {
				return sprintf('[img:%s]%s[/img]', $align, $url);
			} else {
				return sprintf('[img]%s[/img]', $url);
			}
		}

I don't know if $bypass_filter was inserted after that October post or not, but changing it to true does allow images without extensions. I do not, however find where that option can be changed except by hacking the file, nor am I sure that it is not causing some other problem (besides the possible security issue) when I do.

What can anyone tell me about this?

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
You could just build a custom tag for the geocache image via the CP (Tools & Info -> Content Rebuilder -> Custom Tag Editor)


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
Hmm. OK, I'm not sure what all I'm going to need for the markup in order to embed the image. New stuff for me.

When I use:
Code
<img src="http://img.geocaching.com/stats/img.aspx?txt=View+my+profile&uid=\\1">
and enter the uid all I get is the uid between my beginning and ending tags.


Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
OK, just had to keep plugging away at it. The following worked, displaying the image and linking it to the geocaching profile. Your examples over at UBBDev were most helpful.
Code
<?php
$export_tags = array (
  0 => 
  array (
    'tag' => 'GeoStat',
    'descrip' => 'Geocaching Stats',
    'prompt' => 'Your Geocaching.com uid, like xxxxxx-xxxx-xxxx-xxxx-xxxxx',
    'regex' => '([a-f0-9-]+)',
    'markup' => '<a href=\\"http://www.geocaching.com/profile/?guid=\\\\1"><img src=\\"http://img.geocaching.com/stats/img.aspx?txt=View+my+profile&uid=\\\\1">',
  ),
);
?>

Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
Of course I spoke too soon frown

the GeoStat tag works within the body of a message, but not in signatures, which is where I particularly wanted to use it.

I was able to work around that by commenting out the lines in html.inc.php that disallow custom tags in a signature. Since this is the only custom tag I have enabled it shouldn't be an issue.


Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Looks good Don; glad my examples proved useful smile.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
2 members (Nightcrawler, Ruben), 446 guests, and 194 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)