PDA

View Full Version : Show Thread Enhancements - [OzzModz] URL Icon Before Or After Links In Posts


ozzy47
09-07-2014, 10:00 PM
Another mod brought to you by,
https://vborg.vbsupport.ru/external/2015/01/1.png

This is a modification that will will add a url icon before or after every link in your posts. It will also allow you to have different images for internal and external links. You can also set different colors for the links, instead of the default link color.

It is a simple installation, upload the file in the UPLOAD folder, then import the product XML, product-ozzmodz_url_icon

You can edit the options under the settings, [OzzModz] URL Icon Before Or After Links In Posts Settings
You can change the stylevars in each style found under the group OzzModz. Their is thirteen of them and all start with ozzmodz_url_icon_

Complete Feature List
Option to disable the mod completely.
Option to display the image before or after the links.
Option to show different icons for internal and external links.
Option to set a url whitelist, that will be treated as internal links.Complete Stylevar List
ozzmodz_url_icon_images This is used if you are not displaying different images for internal/external links.
ozzmodz_url_icon_images_color Color for links. This is used if you are not displaying different images for internal/external links.
ozzmodz_url_icon_images_hover_color Hover color for links. This is used if you are not displaying different images for internal/external links
ozzmodz_url_icon_images_ext This is used if you are displaying different images for internal/external links, this is for the external link.
ozzmodz_url_icon_images_ext_color Color for external links. This is used if you are displaying different images for internal/external links.
ozzmodz_url_icon_images_ext_hover_color Hover color for external links. This is used if you are displaying different images for internal/external links.
ozzmodz_url_icon_images_int This is used if you are displaying different images for internal/external links, this is for the internal link.
ozzmodz_url_icon_images_int_color Color for internal links. This is used if you are displaying different images for internal/external links.
ozzmodz_url_icon_images_int_hover_color Hover color for internal links. This is used if you are displaying different images for internal/external links.
ozzmodz_url_icon_left_image_margin This is the amount of space inbetween the image and the preceding text, when it is to the left of the links.
ozzmodz_url_icon_left_image_padding This is the amount of space inbetween the image and the link, when it is to the left of the links.
ozzmodz_url_icon_right_image_margin This is the amount of space inbetween the image and the following text, when it is to the right of the links.
ozzmodz_url_icon_right_image_padding This is the amount of space inbetween the link and the image, when it is to the right of the links.Frequently Asked Questions.

Q. How do I upgrade from version 1.x.x to version 2.0.0?

A. Same as installing the mod for the first time. Upload the file in the UPLOAD folder, then import the product XML, product-ozzmodz_url_icon.

Q. Why do I need such a thing, you ask?

A. Some admins might like to have this as it makes it easier for users to identify links in the posts.

Q. How do I change the image(s)?

A. This can be done by editing the stylevars, ozzmodz_url_icon_images, ozzmodz_url_icon_images_ext and ozzmodz_url_icon_images_int found under the group OzzModz in each of your styles.

Q. How do I change the space around the image(s)?

A. This can be done by editing the stylevars, ozzmodz_url_icon_left_image_margin, ozzmodz_url_icon_left_image_padding, ozzmodz_url_icon_right_image_margin and ozzmodz_url_icon_right_image_padding found under the group OzzModz in each of your styles.

Q. How do I change the link color(s)?

A. This can be done by editing the stylevars, ozzmodz_url_icon_images_color, ozzmodz_url_icon_images_hover_color, ozzmodz_url_icon_images_ext_color, ozzmodz_url_icon_images_ext_hover_color, ozzmodz_url_icon_images_int_color and ozzmodz_url_icon_images_int_hover_color found under the group OzzModz in each of your styles.


-------------------------------------------------------------------------------------------

If you like this mod please hit the https://vborg.vbsupport.ru/external/2015/08/1.png button to the right ---->

Please remember to click the, https://vborg.vbsupport.ru/external/2015/08/2.png button to the right if you installed the mod ---->

What does 'Marking As Installed' do ?

* It helps you to stay on top of updates - members who have installed modifications will be notified whenever new updates are available.

* For security issues - vbulletin.org will contact all members who have installed a modification whenever a security issue is brought to their attention.

* Marking a modification as installed also helps me know how many people are using my work, giving me extra incentive to provide more features and new modifications.

I appreciate the support!
-------------------------------------------------------------------------------------------

* History (Changelog) *
-------------------------
v1.0.0 (September 7, 2014)
- Initial public release.

v1.0.1 (September 8, 2014)
- Now it is compatible with the old style postbit.

v1.1.0 (September 11, 2014)
- Deleted the image setting, and made it a stylevar, so you can have different images for each style.

v2.0.0 (October 5, 2014)
- Added ability to have different images for internal/external links.
- Added a url whitelist, that will be treated as internal links.
- Image(s) will no longer show next to the quoted by link in post quotes.
- Images will no longer show up in the attachments box.
- Images will no longer show next to the email links.
- Images will no longer show up next to inline images.
- Added additional stylevars to control the new images, and the padding and margin.
- Added stylevars to set colors for the links.
- Added code to tell the difference between internal/external links.
- Added two more CSS templates, for use with the internal/external images.

v2.0.1 (October 7, 2014)
- Fixed a issue with the CSS not showing in v2.0.0

v2.0.2 (December 3, 2014)
- Added a fix for a potential minor XSS exploit. There was no one that reported this, this is just a update to make sure the mod is fully secure.

ozzy47
09-07-2014, 11:34 PM
Reserved.

ozzy47
09-08-2014, 06:17 PM
Updated the zip, as it was missing the XML. :confused:

IceFanatic
09-09-2014, 01:08 AM
Doesn't seem to work for me. 4.2.2

ozzy47
09-09-2014, 01:15 AM
Doesn't seem to work for me. 4.2.2
Care to send me a admin account so I can check it out?

ozzy47
09-09-2014, 02:19 AM
OK the issue has been fixed. :)

ozzy47
09-09-2014, 02:19 AM
v1.0.1 (September 8, 2014)
- Now it is compatible with the old style postbit.

To upgrade, import the XML, allowing overwrite.

IceFanatic
09-09-2014, 02:26 AM
Beautiful, it works!

ozzy47
09-09-2014, 02:28 AM
Excellent, glad to hear. Thanks for the access so I could see what was going on.

Thanks for marking as installed. :)

New Joe
09-09-2014, 03:36 AM
Well, i spent a long time trying to find the css template edit mod which I've used in the past, found it and used it.
Then you come out with this easy mod which could have saved me a lot of time..lol.
Oh well, at least now I know for the future there is this one here.
Cheers Ozzy

Krusty1231
09-09-2014, 09:34 AM
Will this add the icon to existing threads?

ozzy47
09-09-2014, 09:35 AM
Yes sir, it will add it to all posts that have URL's in them. :)

ozzy47
09-09-2014, 09:35 AM
Well, i spent a long time trying to find the css template edit mod which I've used in the past, found it and used it.
Then you come out with this easy mod which could have saved me a lot of time..lol.
Oh well, at least now I know for the future there is this one here.
Cheers Ozzy

Why not undo your change, and install this one? :p

bzcomputers
09-09-2014, 10:07 AM
Can't seem to get a custom image to show.

Image is placed in your specified directory and name is changed in settings, but default image still shows.

ozzy47
09-09-2014, 10:15 AM
I'll look into it later today when I get home from work. Don't forget to mark as installed. :)

RichieBoy67
09-09-2014, 02:45 PM
Can't seem to get a custom image to show.

Image is placed in your specified directory and name is changed in settings, but default image still shows.

Did you clear your cache and is the image the same size?

Charis
09-09-2014, 03:16 PM
Thank You "Mod Machine".:)

Very nice and useful indeed.:up:

It would be great if we had the ability to disable it and don't show it before/after [email] and attachments.

Nirjonadda
09-09-2014, 03:44 PM
Does it work with [ CODE ][ /CODE ] Tag ?

ozzy47
09-09-2014, 03:59 PM
Does it work with [ CODE ][ /CODE ] Tag ?

Nope, as that is not a live link. :)

bzcomputers
09-09-2014, 05:50 PM
Did you clear your cache and is the image the same size?

Yes and Yes.

https://vborg.vbsupport.ru/external/2014/09/20.png

ozzy47
09-09-2014, 07:17 PM
I have a idea what might be going on. I think instead of having the image in a vBoption, I need to do it as a stylevar. I'll test it out later tonight, and if it works, I'll update the mod.

It might actually be better this way, then you can have different images for each style. :)

ozzy47
09-11-2014, 09:26 AM
I'll try and get the update out today, it works pretty good as a stylevar. :)

ozzy47
09-11-2014, 08:49 PM
v1.1.0 (September 11, 2014)
- Deleted the image setting, and made it a stylevar, so you can have different images for each style.

Marcin1
09-12-2014, 01:54 AM
Before the update was added mod was displayed in thread. Now an image is blank :(

ozzy47
09-12-2014, 01:56 AM
Did you check the stylvars and make sure the image is set, it should be url.png

Marcin1
09-12-2014, 02:19 AM
It's working now! Sorry I missed that step.

ozzy47
09-12-2014, 02:23 AM
TBH it should have set that on install, but for some reason sometimes the stylevars don't get set when you import the mod.

ozzy47
09-12-2014, 09:34 AM
I think I found the issue with the stylevar, it's been fixed in the zip file. :)

bzcomputers
09-12-2014, 12:13 PM
Latest version fixed my issues, custom images work fine now, thanks.

Couple of recommendations for future releases:
1) Add the padding-left/right option to the stylevar
2) Add a margin-left/right option and put it in the stylevar
3) Add the ability to use different icons based on whether the link leaves the site (changes domain) or is an internal link.

OUTL4W
09-12-2014, 01:19 PM
would it be possible to pull in the favicon from the url?...if not that's ok...

ozzy47
09-12-2014, 07:54 PM
Latest version fixed my issues, custom images work fine now, thanks.

Couple of recommendations for future releases:
1) Add the padding-left/right option to the stylevar
2) Add a margin-left/right option and put it in the stylevar
3) Add the ability to use different icons based on whether the link leaves the site (changes domain) or is an internal link.

Those seem possible. :)

ozzy47
09-12-2014, 07:57 PM
would it be possible to pull in the favicon from the url?...if not that's ok...

Just add the favicon to the ozzmodz_mods/ozzmodz_url_icon/images folder, then in the stylevar use, favicon.ico

bzcomputers
09-15-2014, 02:40 AM
Anyway to stop this from adding icon to quoted message "posted by" link:

https://vborg.vbsupport.ru/external/2014/09/6.jpg

...possibly skipping anything referencing class="bbcode_postedby". Actually, it might be better overall if it just didn't add the icon to any link referenced by an <img>.

ozzy47
09-15-2014, 09:35 AM
I am going to have to do some studying on how to stop it from showing on everything.

bzcomputers
09-15-2014, 03:07 PM
I am going to have to do some studying on how to stop it from showing on everything.

Yeah, that may be a pain to figure out.

In the mean time I added this to fix the post quote issue (also had to remove the "!important" reference on the background from the original css):

.bbcode_postedby a {
background: none !important;
padding-left: 0 !important;
}

ozzy47
09-15-2014, 05:12 PM
That's a interesting workaround, and probably the easiest way to do it. :)

ozzy47
10-05-2014, 03:03 PM
v2.0.0 (October 5, 2014)
- Added ability to have different images for internal/external links.
- Added a url whitelist, that will be treated as internal links.
- Image(s) will no longer show next to the quoted by link in post quotes.
- Images will no longer show up in the attachments box.
- Images will no longer show next to the email links.
- Images will no longer show up next to inline images.
- Added additional stylevars to control the new images, and the padding and margin.
- Added stylevars to set colors for the links.
- Added code to tell the difference between internal/external links.
- Added two more CSS templates, for use with the internal/external images.

mitch84
10-05-2014, 03:26 PM
hi, I don't understand, how add a different image for a specific domain?
ex:
vbulletin.org=> image a
vbulletin.com=>image b
thx

ozzy47
10-05-2014, 03:27 PM
That is not possible, only different images for internal/external images.

mitch84
10-05-2014, 04:47 PM
ok, not for me, uninstalled

ozzy47
10-05-2014, 04:51 PM
Not a problem. :)
What in the description made you think you could do that? Was it not clear enough? Just so I know if I need to change the wording.

mitch84
10-06-2014, 06:08 AM
just my english in not perfect :o

Marcin1
10-06-2014, 11:33 AM
It's not working for me after update of product. I reinstalled and nothing show up.

ozzy47
10-06-2014, 11:46 AM
What version did you upgrade from?
Did you check your stylevars and make sure a image is set?
Are the images it the correct location?

Marcin1
10-06-2014, 12:35 PM
It was upgraded from 1.1.0 but didn't work so I uninstalled completely and reinstalled again.

I checkec stylevars and looks ok. Image name url.png

The images are in ozzmodz_mods/ozzmodz_url_icon/images

ozzy47
10-06-2014, 12:44 PM
What about on a unmodified default style?
Does it work with all other mods disabled?

Marcin1
10-06-2014, 01:43 PM
Is possible to upload a 1.1.0 version?

ozzy47
10-06-2014, 02:05 PM
Did you try the above?

Marcin1
10-06-2014, 02:18 PM
Not working at all. I'd like to try a version before upgrading.

ozzy47
10-06-2014, 11:21 PM
So v1.1.0 was working for you?

Marcin1
10-07-2014, 06:52 AM
Exactly, it was. That's why I marked as installed but after upgrade not working at all.

ozzy47
10-07-2014, 09:00 AM
Ok try this then.

Marcin1
10-07-2014, 02:03 PM
It's working on older version. I tried to upgrade again and nothing displayed, so back to 1.1.0 Where is a mistake?

ozzy47
10-07-2014, 07:51 PM
Not sure, I see the same thing as you are reporting on a new site. Will look into it in a bit.

ozzy47
10-07-2014, 10:11 PM
Ok try v2.0.1 that should solve it.

ozzy47
10-07-2014, 10:12 PM
v2.0.1 (October 7, 2014)
- Fixed a issue with the CSS not showing in v2.0.0

Marcin1
10-08-2014, 03:16 AM
It's working now for me. Thanks!

ozzy47
10-08-2014, 08:59 AM
Glad to hear. :)

thetechgenius
10-09-2014, 10:32 PM
If anyone wants different "Internal Link" images, I have 4 different ones I found online, I use the orange one to match better with my forum style. Thanks for the Addon ozzy!

These images are 16x16, same as ozzy's. But I do have them in 32x32 if anyone needs them. Just let me know if you need the larger images, and ill upload them.

ozzy47
10-09-2014, 10:36 PM
If anyone wants different "Internal Link" images, I have 4 different ones I found online, I use the orange one to match better with my forum style. Thanks for the Addon ozzy!

These images are 16x16, same as ozzy's. But I do have them in 32x32 if anyone needs them. Just let me know if you need the larger images, and ill upload them.

Thanks for sharing the images you found. :)

ozzy47
12-04-2014, 12:55 AM
v2.0.2
Added a fix for a potential minor XSS exploit. There was no one that reported this, this is just a update to make sure the mod is fully secure.

pablodip
12-07-2014, 08:11 PM
it's very helpful

ozzy47
12-07-2014, 08:16 PM
Glad you like it, and thanks for marking as installed. :)

CAG CheechDogg
12-10-2014, 09:50 AM
Ozzy my Man... for me it doesn't give me the options "edit" "delete" in the settings ...

Also all links have the external image even though the links are internal ... any idea?

Black Snow
12-10-2014, 09:59 AM
Ozzy my Man... for me it doesn't give me the options "edit" "delete" in the settings ...

Also all links have the external image even though the links are internal ... any idea?

The edit/delete links are only when debug mode (I think it's called) is enabled. It more for developers.

It seems from the image in the OP that it shows an image for internal and external links but with an option to have different ones for both.

CAG CheechDogg
12-10-2014, 10:03 AM
Ok...edit/delete question answered..

I still don't get the internal image for internal links ..still getting the external for all links ...

Could it be because I have https instead of http?

CAG CheechDogg
12-10-2014, 10:23 AM
YEEP !!! That was the issue...

Because I have https enabled on my site the install code has only (http) all through the install xml file ..


This is what I changed for it to work, I replaced all the http references to https ....


from

$domain = htmlspecialchars_uni($_SERVER['HTTP_HOST']);

to

$domain = htmlspecialchars_uni($_SERVER['HTTPS_HOST']);

from

if (href.indexOf("http://")!=-1)

to

if (href.indexOf("https://")!=-1)

from

//return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? false : true;

to

//return (href.indexOf("https://")!=-1 && href.indexOf(hostname)==-1) ? false : true;

Black Snow
12-10-2014, 10:26 AM
Perhaps ozzy47 can update the mod to reflect domain which use HTTPS so people don't have to edit the mod.

CAG CheechDogg
12-10-2014, 10:35 AM
Yes..I am sure he will be able to update as soon as he has time ...hes DA' MAN !!! :)

Black Snow
12-10-2014, 10:37 AM
Another option in the settings to allow admins to select if they use HTTP or HTTPS might do the trick with an edit to the plugin(s) to reflect the new settings.

CAG CheechDogg
12-10-2014, 10:51 AM
That would be good too Black Snow ... but I think a small change to the code and he can make it work with both ....I just don't know how to do it myself that way ... :)

ozzy47
12-10-2014, 11:05 AM
Yeah I can look into it as soon as I get some free time. Glad you were able to figure out the issue though. :)

CAG CheechDogg
12-10-2014, 11:07 AM
No problem Ozzy ... thanks for this nice little mod ....:P