News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Add Sitepreviews to posted urls

Started by Marook, December 26, 2007, 06:02:54 PM

Previous topic - Next topic

Marook

Link to Mod

This mod adds small bubbles with the picture of the linked website to all external links on your smf. This works client-side via a small javascript file. All links which does not contains your hostname (where your smf is installed) will get the preview-bubbles. If you move your mouse cursor over the links, the bubble appears on moving out they disappear.

Update 1.1

  • bubbles only appears on links posted with [ url] tag
  • user can turn on/off the sitepreview in userCP

Update 1.2

  • setting in userCP is turned on by default
  • added small icons indicating an external link

Update 1.3

  • admin can choose between different thumbnailing services
  • admin can turn off the preview function generally
  • admin can choose between different bubble-colors (white, grey, black)
    (Admin CP -> Features and Options -> Layout and Options)

Update 1.31
  • fixes a problem where no bubbles appear when just adding a link without [ url] tag

    Thx Perro88 for the additional bubble-colors.

    You must uninstall any previous versions!

    Update from v1.3 to 1.31
    Just open $sourcedir/Subs.php and find

    'content' => '<a href="$1" target="_blank">$1</a>',

    and replace it with

    'content' => '<a class="preview" href="$1" target="_blank">$1</a>',


    Support for this mod @ http://www.marook-online.de

    Search tags : thumbnail, website, preview, link
SMF Rulez ;) | Meet me home ! | My Mods

sipko

Not working right: I get the same ad on every link from websnapr that reads "thumbnail has been queued" and has a mr wong url at the bottom. 

Marook

Their thumbnail system was offline for a few days, maybe they must recreate the thumbnails. Test it with the url of SMF.org or google, it works fine... take a look
SMF Rulez ;) | Meet me home ! | My Mods

perro88

#3
thanks for the mod. Any idea how to disable the preview on images posted with the [img] tag? or just allow the preview to urls posted?

falguni1


Sabre™

Nice work mate :)

What do I need to do, to get this to work on customised themes?

Thanks in advance  :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

perro88

Quote from: FERNSIDE on December 27, 2007, 08:08:10 AM
Nice work mate :)

What do I need to do, to get this to work on customised themes?

Thanks in advance  :)
just check the modification file, it's just one line of code added on the index.template :P

Apllicmz




Sabre™

#9
LOL..  Thanks Perro88.

I couldnt find it when I looked, so I come on here.

Can you show me the line please :D


Thanks Kindred.
I know how to add/modify the templates.  Just couldnt find the line(s)
And the Package Parser on that site only covers up to 1.1.4.
Not that it'll make much diff, but just incase :D
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


perro88

Quote from: FERNSIDE on December 27, 2007, 08:24:51 PM
LOL..  Thanks Perro88.

I couldnt find it when I looked, so I come on here.

Can you show me the line please :D


Thanks Kindred.
I know how to add/modify the templates.  Just couldnt find the line(s)
And the Package Parser on that site only covers up to 1.1.4.
Not that it'll make much diff, but just incase :D
ok mate, first of all copy the image file to your other theme's image dir.
this is the only modification on the mod :P

<file name="$themedir/index.template.php">
<operation>
<search position="after"><![CDATA[
<title>', $context['page_title'], '</title>';]]></search>
<add><![CDATA[
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sitepreview.js"></script>]]></add>
</operation>
</file>

so open the index.template file from your other theme and find this line <title>', $context['page_title'], '</title>' and add this line before<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sitepreview.js"></script>

Marook

@Perro88 : I'm trying to update the mod, adding a nopreview-class...
SMF Rulez ;) | Meet me home ! | My Mods

Sabre™

LOL..

Thanks Perro..  Worked a treat :)

All the best for the New Year mate.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


perro88

Quote from: FERNSIDE on December 28, 2007, 04:08:11 AM
LOL..

Thanks Perro..  Worked a treat :)

All the best for the New Year mate.
No problem mate, and have also a great new year :D, but well you should thanks Marook instead for making this really nice mod. Well here's a suggestion, when you want to search a modification file open the package-info.xml file and inside it, if it haves different installs to different smf versions, look at the install with your version(or if it just have one install that don't especify version then that will be the install executed in any smf version) and the file beetween this <modification></modification> is the modification file will be executed on the package installer. You probably already know that but well never never a bad idea to remember :P

perro88

#14
Quote from: Marook on December 28, 2007, 02:44:28 AM
@Perro88 : I'm trying to update the mod, adding a nopreview-class...
thanks, that might be useful in some cases. Nice idea you got making this mod.
Well I'll attach here some different "bg.png" files so if someone want to change the preview box just replace the bg.png file.
example(bg.png attached working on this example) and 3 files here.

Marook

yeah thats nice ;) im working at the next version, where the user can turn on/off the previews and i also will provide more thumbnail-preview services than the current. Furthermore i (maybe) add the additional bubbles posted by perro88 so the user can select his preferred bubble ;)
SMF Rulez ;) | Meet me home ! | My Mods

falguni1

I think this mod will largely benefit people as they will preview a link before clicking it and will save them from clicking virus sites.

TheWrath!

can u turn this on globally for all members at once?

ALEJO

#18
very very nice mod ;) but when a link is on the  bottom of the web the bubble doesnt goes up... here a screen*  i would be great if u can fix it to auto detect the border of the explorer and the bubble pop up not down ;)
*
solo el mas paranoico sobrevive

Marook

#19
The latest version does not support every link on the pages... the bubble only appears to links posted with [ url] tag... so there is nothing more to fix ;)

@ BRFRWebGuy! : download the new version 1.2, there the setting is turned on by default

Update 1.3 will be released soon !!
Features :
Admin can select, bubble style (white, grey, black) thx perro88 !
Admin can select different thumbnailing-services (art-viper, websnapr, snap)
Admin can globally turn off sitepreviews
Options will be found at : AdminCP ->Features and Options ->Layout and Options
SMF Rulez ;) | Meet me home ! | My Mods

Advertisement: