Legacy Need mailto links to work from the forum ads product

Status
Not open for further replies.

designguy

Customer
I have some advertisers that just want (or need) a mailto link instead of a http link. This currently doesn't work in the forum ads product. Really it should support that kind of link so I am requesting it.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
If you're comfortable editing code, I have a potential implementation for this:

Open /dbtech/forumads/includes/class_core.php and find:
PHP:
					if ($banner['extension'] AND file_exists(DIR . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension']))
					{
						$imageinfo = @getimagesize(self::$vbulletin->options['bburl'] . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension']);
						if (is_array($imageinfo) AND $imageinfo[1])
						{
							// The actual banner itself
							$banner['banner'] = '
								<a href="' . self::$vbulletin->options['bburl'] . '/forumads.php?' . self::$vbulletin->session->vars['sessionurl'] . 'do=out&contenttype=banner&contentid=' . $banner['bannerid'] . '" target="_blank" title="' .  htmlspecialchars_uni($banner['sitetitle']) . '">
									<div class="dbtech-wrapper-block dbtech-wrapper-block-noblockbg" style="width:' . $imageinfo[0] . 'px; height:' . $imageinfo[1] . 'px;">
										<img src="' . self::$vbulletin->options['bburl'] . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension'] . '" style="max-width:' . $bannerspace['dimensions']['width'] . 'px; max-height:' . $bannerspace['dimensions']['height'] . 'px;" />
									</div>
								</a>
							';
						}
						else
						{
							// In case we don't have GD
							$banner['banner'] = '
								<a href="' . self::$vbulletin->options['bburl'] . '/forumads.php?' . self::$vbulletin->session->vars['sessionurl'] . 'do=out&contenttype=banner&contentid=' . $banner['bannerid'] . '" target="_blank" title="' .  htmlspecialchars_uni($banner['sitetitle']) . '">
									<div class="dbtech-wrapper-block">
										<img src="' . self::$vbulletin->options['bburl'] . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension'] . '" style="max-width:' . $bannerspace['dimensions']['width'] . 'px; max-height:' . $bannerspace['dimensions']['height'] . 'px;" />
									</div>
								</a>
							';
						}
					}

Replace with:
PHP:
					if ($banner['extension'] AND file_exists(DIR . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension']))
					{
						$bannerLink = (strpos($banner['url'], 'mailto:') === 0 ? $banner['url'] : (self::$vbulletin->options['bburl'] . '/forumads.php?' . self::$vbulletin->session->vars['sessionurl'] . 'do=out&contenttype=banner&contentid=' . $banner['bannerid']));

						$imageinfo = @getimagesize(self::$vbulletin->options['bburl'] . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension']);
						if (is_array($imageinfo) AND $imageinfo[1])
						{
							// The actual banner itself
							$banner['banner'] = '
								<a href="' . $bannerLink . '" target="_blank" title="' .  htmlspecialchars_uni($banner['sitetitle']) . '">
									<div class="dbtech-wrapper-block dbtech-wrapper-block-noblockbg" style="width:' . $imageinfo[0] . 'px; height:' . $imageinfo[1] . 'px;">
										<img src="' . self::$vbulletin->options['bburl'] . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension'] . '" style="max-width:' . $bannerspace['dimensions']['width'] . 'px; max-height:' . $bannerspace['dimensions']['height'] . 'px;" />
									</div>
								</a>
							';
						}
						else
						{
							// In case we don't have GD
							$banner['banner'] = '
								<a href="' . $bannerLink . '" target="_blank" title="' .  htmlspecialchars_uni($banner['sitetitle']) . '">
									<div class="dbtech-wrapper-block">
										<img src="' . self::$vbulletin->options['bburl'] . '/dbtech/forumads/images/banners/' . $banner['bannerid'] . '.' . $banner['extension'] . '" style="max-width:' . $bannerspace['dimensions']['width'] . 'px; max-height:' . $bannerspace['dimensions']['height'] . 'px;" />
									</div>
								</a>
							';
						}
					}

Do note that this means outgoing clicks cannot be tracked for mailto: URLs so you should not configure any banner spaces that uses this metric as its method of sale.
 
Thanks for the modification! This works perfectly! Now if we could just be able to put banners wherever we would like, that would be cool for a future feature. I am also implementing a mod from here: Miscellaneous Hacks - Rotating Banner System - vBulletin.org Forum called the Rotating Banner System which does allow me to place a banner wherever I put their insert code, but sadly, it doesn't track and automate the buying and uploading process like ForumAds does. If we had a combination of these two mods for ForumAds, this would really be a super killer product.
 
Hello designguy,

This ticket has now been closed with the status Implemented.

We hope your issue or question has been addressed to your satisfaction. If not, please feel free to re-open it by clicking this link.

If you have any further issues or questions, please feel free to start a new support ticket via the button at the top of every page.

Thank you!
 
Status
Not open for further replies.
Back
Top