Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Marook on December 26, 2007, 06:02:54 PM

Title: Add Sitepreviews to posted urls
Post by: Marook on December 26, 2007, 06:02:54 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1040)

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

Update 1.2

Update 1.3

Update 1.31
Title: Re: Add Sitepreviews to external links
Post by: sipko on December 26, 2007, 06:38:41 PM
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. 
Title: Re: Add Sitepreviews to external links
Post by: Marook on December 26, 2007, 11:58:58 PM
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
Title: Re: Add Sitepreviews to external links
Post by: perro88 on December 27, 2007, 01:17:44 AM
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?
Title: Re: Add Sitepreviews to external links
Post by: falguni1 on December 27, 2007, 04:16:49 AM
nice mod.
Title: Re: Add Sitepreviews to external links
Post by: Sabre™ 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  :)
Title: Re: Add Sitepreviews to external links
Post by: Kindred on December 27, 2007, 08:16:33 AM
Please read:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

http://www.simplemachines.org/community/index.php?topic=34526.0 (http://www.simplemachines.org/community/index.php?topic=34526.0)

The following may also prove helpful:

http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)
Title: Re: Add Sitepreviews to external links
Post by: perro88 on December 27, 2007, 09:14:23 AM
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
Title: Re: Add Sitepreviews to external links
Post by: Apllicmz on December 27, 2007, 10:51:29 AM
Nice Work
Nice Mod
Title: Re: Add Sitepreviews to external links
Post by: Sabre™ 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
Title: Re: Add Sitepreviews to external links
Post by: perro88 on December 27, 2007, 08:59:16 PM
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>
Title: Re: Add Sitepreviews to external links
Post by: Marook on December 28, 2007, 02:44:28 AM
@Perro88 : I'm trying to update the mod, adding a nopreview-class...
Title: Re: Add Sitepreviews to external links
Post by: Sabre™ on December 28, 2007, 04:08:11 AM
LOL..

Thanks Perro..  Worked a treat :)

All the best for the New Year mate.
Title: Re: Add Sitepreviews to external links
Post by: perro88 on December 28, 2007, 09:01:40 AM
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
Title: Re: Add Sitepreviews to external links
Post by: perro88 on December 28, 2007, 09:10:02 AM
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.
Title: Re: Add Sitepreviews to external links
Post by: Marook on December 28, 2007, 11:02:49 AM
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 ;)
Title: Re: Add Sitepreviews to external links
Post by: falguni1 on December 28, 2007, 02:22:54 PM
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.
Title: Re: Add Sitepreviews to posted urls
Post by: TheWrath! on January 06, 2008, 10:50:44 PM
can u turn this on globally for all members at once?
Title: Re: Add Sitepreviews to posted urls
Post by: ALEJO on January 07, 2008, 04:46:22 PM
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 ;)
*
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg239.imageshack.us%2Fimg239%2F1975%2Fvistapreviaah8.png&hash=f00239e7297b0abfce4f6415af238d2cac50aa5f) (http://img239.imageshack.us/img239/1975/vistapreviaah8.png)
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 07, 2008, 11:42:38 PM
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
Title: Re: Add Sitepreviews to posted urls
Post by: ALEJO on January 08, 2008, 01:04:28 PM
Quote from: Marook on January 07, 2008, 11:42:38 PM
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
this happens on post with [url] tags too, when i pass the pointer over a url the pop up goes always down, and not up when is at the end of the browser
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 08, 2008, 07:37:28 PM
sorry for bothering but just want to know if you have a idea if wouldn't be too difficult to integrate the mod with for example smf links (the links are internal because they have a click counter so it won't show the preview). well probably is very hard to do or don't even possible, the only chance might be delete that counter number of clicks counter on the smf links and make the links externals
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 08, 2008, 07:43:00 PM
The space between the last post and the footer is in most case heigh enough to display the preview bubble. Maybe in the future i will implement a detecting mechanism. It needs another flipped image of the bubble and some more lines of code...

@ perro88: gimme the link of the mod or whatever it is, i wil look through the code and post a modified one...
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 08, 2008, 07:53:17 PM
Quote from: Marook on January 08, 2008, 07:43:00 PM
The space between the last post and the footer is in most case heigh enough to display the preview bubble. Maybe in the future i will implement a detecting mechanism. It needs another flipped image of the bubble and some more lines of code...

@ perro88: gimme the link of the mod or whatever it is, i wil look through the code and post a modified one...
whoa mate thanks.
http://custom.simplemachines.org/mods/index.php?mod=381
the other mod is a listing of links(sorted by categories etc) with a option to rate and a counter of how many times someone on the forum clicked on the link, so that counter seems to work something like the links on the mod are not the external links but a internal link to probably make a query and incremment the number of clicks of the link and then redirect to the real external link. I don't  know javascript but maybe it's possible to do something like post the external link and then with javascript increment the number of clicks? well dunno, really thanks for checking this even when is not 100% related to your mod and probably you're a busy man hehe
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 08, 2008, 08:09:46 PM
its very easy to modify the template.

Open themedir/Link.template.php and search for sa=visit;id=
In every line you found this string, change the <a> tag by adding class="preview"

For example... line 118
<a class="preview" href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a>&nbsp;';
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 08, 2008, 08:24:40 PM
Quote from: Marook on January 08, 2008, 08:09:46 PM
its very easy to modify the template.

Open themedir/Link.template.php and search for sa=visit;id=
In every line you found this string, change the <a> tag by adding class="preview"

For example... line 118
<a class="preview" href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a>&nbsp;';

tried on the virtual server on my pc and didn't do the trick, will upload the links.template.php to the server to check if there's a difference.
Still, how adding that class could make show the external link if the <a> tag is of one internal link?
EDIT: wait I'm a idiot I didn't installed the new version hehe. strange. installed mannualy the 1.2 version and the preview image is not being dysplayed, just the buble. well I'll check it tomorrow
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 08, 2008, 09:51:47 PM
locally it doesnt work, because the link points to localhost or 127.0.0.1 and the tumbnailservice can't serve this address to get a thumbnail... i tried it online and it works fine. Btw, it seems that websnapr.com is offline again, thats the reason why you didn't get any thumbs.... i'm currently workin on v1.3, there the admin can choose between 5 different thumbnailingservices... stay tuned ;)
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 09, 2008, 12:59:28 PM
Quote from: Marook on January 08, 2008, 09:51:47 PM
locally it doesnt work, because the link points to localhost or 127.0.0.1 and the tumbnailservice can't serve this address to get a thumbnail... i tried it online and it works fine. Btw, it seems that websnapr.com is offline again, thats the reason why you didn't get any thumbs.... i'm currently workin on v1.3, there the admin can choose between 5 different thumbnailingservices... stay tuned ;)
that's a great idea like that one of create a preview class, with that options will be very easy to customize the mod as the user want, great mod thanks :P, yep the thumbnails site was down hehe
Title: Re: Add Sitepreviews to posted urls
Post by: ALEJO on January 09, 2008, 01:13:27 PM
Quote from: Marook on January 08, 2008, 07:43:00 PM
The space between the last post and the footer is in most case heigh enough to display the preview bubble. Maybe in the future i will implement a detecting mechanism. It needs another flipped image of the bubble and some more lines of code...
thx ;)
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 09, 2008, 02:12:38 PM
Quote from: Marook on January 08, 2008, 08:09:46 PM
its very easy to modify the template.

Open themedir/Link.template.php and search for sa=visit;id=
In every line you found this string, change the <a> tag by adding class="preview"

For example... line 118
<a class="preview" href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a>&nbsp;';

if I make this and it gives a invalid request on the buble probably because it's a internal the link, the only chance in this case is probably delete that counter and make that links externals(dunno if it's possible to still use the counter with external links maybe with javascript )
btw on the new version of your mod I can't see preview of urls with the http:// before(added without the url tag, but without the url tag and also without the http:// works). well will do more tests
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 09, 2008, 03:39:10 PM
I'm also using a link script and i also have the same problem, but i found out that the first time the preview appears, you will see a thumbnail of your own site. Because its an internal link, but waiting  a few seconds (sometimes maybe some minutes) you will see the correct thumbnail of the linked site. It seems, that the spider (or bot) follows the internal link and will redirected to the corrected site. Try to test this, otherwise im gonna have a close look into the source...
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 09, 2008, 04:56:38 PM
Quote from: Marook on January 09, 2008, 03:39:10 PM
I'm also using a link script and i also have the same problem, but i found out that the first time the preview appears, you will see a thumbnail of your own site. Because its an internal link, but waiting  a few seconds (sometimes maybe some minutes) you will see the correct thumbnail of the linked site. It seems, that the spider (or bot) follows the internal link and will redirected to the corrected site. Try to test this, otherwise im gonna have a close look into the source...
thanks I'll try it.
I noticed something dunno if it is because other mod I have installed but for example on the first version of your mod
if you post something like
www.simplemachines.org
http://www.simplemachines.org
www.simplemachines.org (http://www.simplemachines.org)
http://www.simplemachines.org (http://http:/www.simplemachines.org)
the preview would work on the 4 links but on my site with the new version the links with http and without url tag never get the preview :P
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 09, 2008, 05:33:35 PM
ah yeah, i changed the mod displaying the preview only on link posted with the [ url] tag.
But it should doesnt matter, if the http:// prefix is added or not...

If you want to display the preview on any other urls, simply add the preview-class to the <a> tag
for example <a class="preview" href=http://www.google.com>Google</a>
Title: Re: Add Sitepreviews to posted urls
Post by: ALEJO on January 22, 2008, 02:52:58 AM
i got an idea, when u put r mouse over a link that is .zip .rar o something like that it says "frobbiden request" i would be great if it shows in the rar files the winrar logo on the zip files the winzip logo... and so on... ;) just an idea
Title: Re: Add Sitepreviews to posted urls
Post by: debbiem626 on January 22, 2008, 04:42:47 PM
I tried adding this mod today and lost the entire forum.   Can you tell me what files I need to edit to get it back?

I'm getting these errors..

function sitepreview(){ global $context, $settings, $options, $scripturl, $txt, $modSettings; $service_urls = array('http://www.artviper.net/screenshots/screener.php?url=', 'http://images.websnapr.com/?size=S&url=', 'http://shots.snap.com/preview/?url=', 'http://www.iwebtool2.com/img/?domain=', 'http://snapr.seekxl.de/?size=s&url=', 'http://www.thumbalizr.com/api/?width=202&url=' ); $bubbles = array('bg.png','bg2.png','bg3.png'); if (!isset($modSettings['sitepreview_disabled']) || $modSettings['sitepreview_disabled'] == 0){ if (!empty($options['sitepreview']) || !isset($options['sitepreview'])) echo ' '; if (!empty($options['sitepreview']) || !isset($options['sitepreview'])) echo ' '; } }



Fatal error: Call to undefined function: sitepreview() in /home/summer51/public_html/Sources/Load.php(1729) : eval()'d code on line 80


Thanks.. help is greatly appreciated.
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 22, 2008, 04:53:51 PM
you can open your index.template.php and remove the call to the function sitepreview();

Or open the install.xml inside the zip and reverse the changes....
Title: Re: Add Sitepreviews to posted urls
Post by: DHC on January 22, 2008, 10:18:11 PM
Quote from: Marook on January 09, 2008, 05:33:35 PM
ah yeah, i changed the mod displaying the preview only on link posted with the [ url] tag.
But it should doesnt matter, if the http:// prefix is added or not...

If you want to display the preview on any other urls, simply add the preview-class to the <a> tag
for example <a class="preview" href=http://www.google.com>Google</a>

We have noticed that when the "Insert Hyperlink" is used, the preview works fine. When the site is referenced as www.sitexyx.com, the preview works fine. However, when the site is referenced as http://www.sitexyz.com, the preview does NOT work at all.

It seems the preview does NOT work whenever the URL is preceeded with 'http://'. Can that be changed so that preview DOES work with the 'http://' in the URL?
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 23, 2008, 12:07:40 AM
Yeah you're right... damn ;(

But its easy to fix, i'm gonna update the mod in the next days...

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>',


Thats it...
Title: Re: Add Sitepreviews to posted urls
Post by: DHC on January 23, 2008, 09:15:26 AM
Quote from: Marook on January 23, 2008, 12:07:40 AM
Yeah you're right... damn ;(

But its easy to fix, i'm gonna update the mod in the next days...

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>',


Thats it...

Nope - that didn't work either. It caused some strange behavior, so I've reverted and will wait for the update.

Thanks!
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 23, 2008, 09:59:16 AM
update is already available, but i just added this one change.... gimme you'r subs.php, i will fix that for you. Please use my NoPaste (http://www.marook-online.de/index.php/action,nopaste.html) instead of posting code here with the code tag...
Title: Re: Add Sitepreviews to posted urls
Post by: bderen on January 24, 2008, 04:51:44 PM
One of the best mods to date.  I've able to get it to work with other themes by just copying the images to images folder and adding that line to the index.template.php file

The only thing that still doesnt work is the little icon that appear in the default theme and it doesn't work with other theme (talking about the icon next to the link)
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 24, 2008, 09:41:29 PM
thx ;) you must add this line also to your template


<link rel="stylesheet" type="text/css" href="<http://www.path_to_your_smf.dir>/Themes/<yourtheme>/nopaste.css?fin11" />

Title: Re: Add Sitepreviews to posted urls
Post by: Sabre™ on January 25, 2008, 04:44:55 AM
Hi Marook..

Awesome mod buddy.

Im sticking with sitepreview10, as I have no problems with it.

Just a quick question, where would I look and change, to enlarge the image box?
Would like it to be atleast twice the size, so my users could actually read what is on the page displaying.    This way, they can decide whether they want to visit that site or not.

Thanks alot mate  :)
Title: Re: Add Sitepreviews to posted urls
Post by: bderen on January 25, 2008, 09:04:04 AM
Quote from: FERNSIDE on January 25, 2008, 04:44:55 AM
Hi Marook..

Awesome mod buddy.

Im sticking with sitepreview10, as I have no problems with it.

Just a quick question, where would I look and change, to enlarge the image box?
Would like it to be atleast twice the size, so my users could actually read what is on the page displaying.    This way, they can decide whether they want to visit that site or not.

Thanks alot mate  :)

+1
Title: Re: Add Sitepreviews to posted urls
Post by: bderen on January 25, 2008, 09:04:59 AM
Quote from: Marook on January 24, 2008, 09:41:29 PM
thx ;) you must add this line also to your template


<link rel="stylesheet" type="text/css" href="<http://www.path_to_your_smf.dir>/Themes/<yourtheme>/nopaste.css?fin11" />



where exactly does this go again?  file/location within?
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 25, 2008, 06:10:35 PM
Quote from: bderen on January 25, 2008, 09:04:59 AM
where exactly does this go again?  file/location within?

Index.template.php somewhere between the <head> </head> tags

@ Fernside : first you need to replace the bubble-images with larger ones. Then you open Index.template.php and scroll down, you will find a function called sitepreview(). You need to alter the urls by changing the w & h parameter. After that you need to open sitepreviews.js and change also the width/height parameter in line 128/129. Thats it...
Title: Re: Add Sitepreviews to posted urls
Post by: Chriss Cohn on January 25, 2008, 09:49:56 PM
Wow a real cool mod  ;D
Kepp up the good work  :)
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 27, 2008, 12:52:53 PM
hi again and sorry for bothering again :P. Whould be hard to create for example a preview2 class that works as the other preview class but without that link image?(it's because I wanna add that class for example on some links as website icon on memberlist, dysplay.template,msn,icq etc and well on small icons with links). thanks
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 27, 2008, 01:08:22 PM
That's easy but there is much work to do... the second class is done with a few lines of css+java code... but i've to alter the display.template.php and change all links to be used with the new previewclass... maybe in the next version. You can remove the link image if you want by commenting-out the preview-class in the css file...
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on January 27, 2008, 01:28:25 PM
Quote from: Marook on January 27, 2008, 01:08:22 PM
That's easy but there is much work to do... the second class is done with a few lines of css+java code... but i've to alter the display.template.php and change all links to be used with the new previewclass... maybe in the next version. You can remove the link image if you want by commenting-out the preview-class in the css file...
thanks , well it's not really that usefull, probably theres  a lot of better things to implement
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 27, 2008, 01:42:05 PM
yeah thats cool...
Title: Re: Add Sitepreviews to posted urls
Post by: topdog2k on January 28, 2008, 05:58:01 PM
Quote from: Marook on January 25, 2008, 06:10:35 PM

@ Fernside : first you need to replace the bubble-images with larger ones. Then you open Index.template.php and scroll down, you will find a function called sitepreview(). You need to alter the urls by changing the w & h parameter. After that you need to open sitepreviews.js and change also the width/height parameter in line 128/129. Thats it...


Question...I am not sure how to change the width and height parameters for the url's on the function sitepreview() in the index.template.php file.

$service_urls = array('http://www.artviper.net/screenshots/screener.php?url=',
                        'http://images.websnapr.com/?size=S&url=',
                        'http://shots.snap.com/preview/?url=',
                        'http://www.iwebtool2.com/img/?domain=',
                        'http://snapr.seekxl.de/?size=s&url=',
                        'http://www.thumbalizr.com/api/?width=202&url='



The other question...I use the helios theme and made the required changes to the index.template.php file for that theme and it works great, but when I change the bubble colour or the service url in my admin panel, it saves the settings, but it doesn't actually apply the changes.


Thanks for the help!
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 29, 2008, 01:23:24 AM
not every serviceprovider will provide an option to change the thumbnail size...sometimes you must add a w & h parameter like this :
hxxp://www.thumbnailer.net/?w=300&h=400&url=www.google.com
Title: Re: Add Sitepreviews to posted urls
Post by: juanpons14 on January 30, 2008, 12:06:45 PM
if i wan that the checkbox in the profile start as activate how can I do it??
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 30, 2008, 04:31:08 PM
install the latest version...there the option is set on by default.
Title: Re: Add Sitepreviews to posted urls
Post by: jurdim on January 30, 2008, 05:00:22 PM
hy love this mod
i installed it last week and it worked fine til tonight now i only get thumbnail has been queued or unable to capture screenshot

What is the standard provider set for the thumbnails.

Gr Jurgen
Title: Re: Add Sitepreviews to posted urls
Post by: Organic on January 31, 2008, 02:04:12 AM
Thank you for this mod. I loved it for the first 12 hours or so, then it stopped working last night. I'm getting the 'Unable to capture screenshot' message. So I went to their site & registered my site, thinking that may help & I was sent a developer key & told to "Please always include this key when requesting images from websnapr.com."

Could this be why it's stopped working for me & Jurdim around the same time? Has Websnapr decided to crack down on us or something? Is there anything we can do?


Title: Re: Add Sitepreviews to posted urls
Post by: jurdim on January 31, 2008, 03:00:24 AM
Some  site previews are working again others in the same page are stil showing 'Unable to capture screenshot'

take a look here in my forum: http://www.khvinfo.nl/smf/index.php?topic=21.0

Gr Jurgen
Title: Re: Add Sitepreviews to posted urls
Post by: Trashcan on January 31, 2008, 10:42:42 AM
installed and works great.  love the mod.  thanks
Title: Re: Add Sitepreviews to posted urls
Post by: Organic on January 31, 2008, 12:57:21 PM
Yep, mine have finally come back as well.
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on January 31, 2008, 07:32:37 PM
From time to time some thumbnail provider gets problems and their service is down for a few days... i recommend snap.com or artviper.net !
Title: Re: Add Sitepreviews to posted urls
Post by: miregrobar on February 01, 2008, 09:46:28 PM
Very nice mod.I like it
Title: Re: Add Sitepreviews to posted urls
Post by: slackerpunk on February 01, 2008, 10:57:11 PM
it works but not 100%..

1. i copied all the images to my themes/being used theme/images
2. edited index.template.php

a. www.site.com [url=http://site.com] site.com [/url] [url=http://www.site.com]name[/url] works just fine
b. site with http:// does not show the preview
c. another thing i tried changing the settings ot use the black BG but my still still shows previews using the white bg
d. tried changing between snap.com and other service but based on previews showing up its still using the same service after changing to another like artvpr.com
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on February 02, 2008, 02:42:02 AM
Check your database (table settings, near last page) for the settings which begins with "sitepreview". If you won't find any, the mod isn't correctly installed. For the issue, where no preview is shown by plain links, see this fix : http://www.simplemachines.org/community/index.php?topic=213254.msg1394136#msg1394136
Title: Re: Add Sitepreviews to posted urls
Post by: Fallen Angel on February 03, 2008, 05:52:21 AM
HELP......................

The mod works fine under DilberMC, BUT now my Auto Embed Video Clips don't work proberly..

Can I somehow make the mod ignore YouTube links or huh????
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on February 03, 2008, 08:26:56 AM
 I'll fix it asap but i must know whats happening when you post a youtube video...
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on February 03, 2008, 09:07:37 AM
Quote from: Fallen Angel on February 03, 2008, 05:52:21 AM
HELP......................

The mod works fine under DilberMC, BUT now my Auto Embed Video Clips don't work proberly..

Can I somehow make the mod ignore YouTube links or huh????
Same happened to me, I made just a stupid change on a line of code and it started working :P
search on subs.php:
array(
'tag' => 'url',

there're 2 of the url arrays, the first one is for the url tags the other is for the url without url tag.
just change on the first one this:
<a class="preview" href="$1" target="_blank">$1</a>
for this:
<a href="$1" class="preview" target="_blank">$1</a>
:P. Give it a try at least it worked here
Title: Re: Add Sitepreviews to posted urls
Post by: Fallen Angel on February 03, 2008, 12:48:41 PM
Quote from: Marook on February 03, 2008, 08:26:56 AM
I'll fix it asap but i must know whats happening when you post a youtube video...

It's fixed by pewrro88..................  ;)
Title: Re: Add Sitepreviews to posted urls
Post by: Fallen Angel on February 03, 2008, 01:00:15 PM
QuoteSame happened to me, I made just a stupid change on a line of code and it started working :P
search on subs.php:
array(
'tag' => 'url',

there're 2 of the url arrays, the first one is for the url tags the other is for the url without url tag.
just change on the first one this:
<a class="preview" href="$1" target="_blank">$1</a>
for this:
<a href="$1" class="preview" target="_blank">$1</a>
:P. Give it a try at least it worked here


That worked....... Thanx man............. U made my day...............
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on February 03, 2008, 02:54:02 PM
Quote from: Fallen Angel on February 03, 2008, 01:00:15 PM
QuoteSame happened to me, I made just a stupid change on a line of code and it started working :P
search on subs.php:
array(
'tag' => 'url',

there're 2 of the url arrays, the first one is for the url tags the other is for the url without url tag.
just change on the first one this:
<a class="preview" href="$1" target="_blank">$1</a>
for this:
<a href="$1" class="preview" target="_blank">$1</a>
:P. Give it a try at least it worked here


That worked....... Thanx man............. U made my day...............
you're welcome.
Title: Re: Add Sitepreviews to posted urls
Post by: microbone on February 06, 2008, 09:58:58 AM
Quote from: Marook on February 02, 2008, 02:42:02 AM
Check your database (table settings, near last page) for the settings which begins with "sitepreview". If you won't find any, the mod isn't correctly installed. For the issue, where no preview is shown by plain links, see this fix : http://www.simplemachines.org/community/index.php?topic=213254.msg1394136#msg1394136

I did a manual install and it seems to work just fine with the exception for the storage of the settings under admin.

Used the http://www.smfhacks.com packageparser to help me....

Could you please explain what needs to be added/modified in the database?
I have run through the code and install file a few times now, a bit sleepy but i simply cant seem to find something that adds/install extra fields to the database or where that is modded.
I even tried without the help form http://www.smfhacks.com parser and got the same result, everythihng seems to be going right except the storage of settings in side admin panel like mentioned before....

So if you are able to clearify what needs to be done that would be great :)
Title: Re: Add Sitepreviews to posted urls
Post by: Sabre™ on February 07, 2008, 12:54:04 AM
Quote from: Marook on January 25, 2008, 06:10:35 PM
@ Fernside : first you need to replace the bubble-images with larger ones. Then you open Index.template.php and scroll down, you will find a function called sitepreview(). You need to alter the urls by changing the w & h parameter. After that you need to open sitepreviews.js and change also the width/height parameter in line 128/129. Thats it...

In my Index.template.php   there is no line containing  "sitepreview()"
The only line with sitepreview in it is this one:
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sitepreview.js"></script>

Im using the first version of this mod.

Sorry I took a while gettin back to ya. :-)
Cheers Marook.
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on February 07, 2008, 04:13:57 AM
The settings are stored in {$db_prefix}smf_settings. You can use Phpmyadmin and insert 3 new entries.






VariableValue
sitepreview_disabled0
sitepreview_selectArtviper.net
sitepreview_bubbleWhite

Normally these new entries were added by the forum automaticly, it seems there are some lines missing...
Title: Re: Add Sitepreviews to posted urls
Post by: microbone on February 07, 2008, 04:24:36 AM
thanks for your reply :)

Had a look into my db and yes missing the line:

sitepreview_disabled

the other 2 are there....

Another thing i noticed is that the values differ!
You have :
sitepreview_select   Artviper.net
sitepreview_bubble   White

I have:
sitepreview_select   5
sitepreview_bubble   1
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on February 07, 2008, 04:41:04 AM
ok it could be.. i just looked at the source not in the db... thought i was saving the strings instead of their index number...
Title: Re: Add Sitepreviews to posted urls
Post by: microbone on February 07, 2008, 05:10:35 AM
ahh ok....

well added the missing line and tried to change settings through the admin section.

They are all now changed in the db but there´s no effect on the site. It still uses websnap and still uses white box even though the values in the db is changing as they should.
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on February 07, 2008, 12:46:38 PM
Quote from: microbone on February 07, 2008, 05:10:35 AM
ahh ok....

well added the missing line and tried to change settings through the admin section.

They are all now changed in the db but there´s no effect on the site. It still uses websnap and still uses white box even though the values in the db is changing as they should.
teah that also happens to me even when installed it on a new smf test forum
Title: Re: Add Sitepreviews to posted urls
Post by: Sabre™ on February 07, 2008, 10:37:57 PM
Quote from: FERNSIDE on February 07, 2008, 12:54:04 AM
Quote from: Marook on January 25, 2008, 06:10:35 PM
@ Fernside : first you need to replace the bubble-images with larger ones. Then you open Index.template.php and scroll down, you will find a function called sitepreview(). You need to alter the urls by changing the w & h parameter. After that you need to open sitepreviews.js and change also the width/height parameter in line 128/129. Thats it...

In my Index.template.php   there is no line containing  "sitepreview()"
The only line with sitepreview in it is this one:
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sitepreview.js"></script>

Im using the first version of this mod.

Sorry I took a while gettin back to ya. :-)
Cheers Marook.

So Im guessing this cannot be done with the first version??
Title: Re: Add Sitepreviews to posted urls
Post by: Marook on February 08, 2008, 03:19:52 PM
@ fernside : right, you need the latest...

you have to call the function sitepreviews() in the index.template.php before the </head> tag...
Title: Re: Add Sitepreviews to posted urls
Post by: Trinny on February 09, 2008, 03:58:32 PM
Awesome mod, easily installed and works perfectly. Thank you.
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on February 09, 2008, 11:43:50 PM
sorry for bother again :P. ANy idea how to disable the preview or at least just the small external icon for link ended in for example .pdf or .zip? thanks
Title: Re: Add Sitepreviews to posted urls
Post by: Kender on February 24, 2008, 07:39:49 AM
the mod just stopped working for me, seemed to work fine and then now i get a bubble with a broken image inside of it instead of my preview
Title: Re: Add Sitepreviews to posted urls
Post by: Kender on February 24, 2008, 01:29:06 PM
well, it started working again... could it be that the server that runs the previews was down?  (i assume thats how it works)
Title: Re: Add Sitepreviews to posted urls
Post by: samurai-lupin on April 11, 2008, 11:33:04 PM
Hello,

I like your mod but would like to ask if there is a possibiliyt to translate the following text (contained in the link pop up) into a different language?

Website Preview [disable]

Would you like to disable website preview fature?


Is this text stored anywhere in the smf installation or is it provided by the thumbnail service and can't be changed at all?

Thank you
Title: Re: Add Sitepreviews to posted urls
Post by: Sabre™ on April 21, 2008, 01:15:26 AM
Quote from: perro88 on February 03, 2008, 09:07:37 AM
I made just a stupid change on a line of code and it started working :P
search on subs.php:
array(
'tag' => 'url',

there're 2 of the url arrays, the first one is for the url tags the other is for the url without url tag.
just change on the first one this:
<a class="preview" href="$1" target="_blank">$1</a>
for this:
<a href="$1" class="preview" target="_blank">$1</a>
:P. Give it a try at least it worked here

Cheers mate.
I searched for over an hour, trying to remember where I saw this post. lol
Thank You very much. :)
Title: Re: Add Sitepreviews to posted urls
Post by: perro88 on May 03, 2008, 04:54:15 PM
Quote from: Sabre™ on April 21, 2008, 01:15:26 AM
Quote from: perro88 on February 03, 2008, 09:07:37 AM
I made just a stupid change on a line of code and it started working :P
search on subs.php:
array(
'tag' => 'url',

there're 2 of the url arrays, the first one is for the url tags the other is for the url without url tag.
just change on the first one this:
<a class="preview" href="$1" target="_blank">$1</a>
for this:
<a href="$1" class="preview" target="_blank">$1</a>
:P. Give it a try at least it worked here

Cheers mate.
I searched for over an hour, trying to remember where I saw this post. lol
Thank You very much. :)
hehe Np, glad it helped
Title: Re: Add Sitepreviews to posted urls
Post by: InternetMafia on October 09, 2008, 07:39:56 PM
Any chance of getting this mod compatible for 1.1.6
Title: Re: Add Sitepreviews to posted urls
Post by: queennikki1972 on September 20, 2014, 10:07:29 PM
Could not find a version for smf 2.0 trying to do site preview globally..

Any plans on an update?

Nikki
Title: Re: Add Sitepreviews to posted urls
Post by: Kindred on September 20, 2014, 10:18:43 PM
Given that the last update for this was in 2008 and that the original author's website is gone... Likely no
Title: Re: Add Sitepreviews to posted urls
Post by: Melonking on March 14, 2023, 11:15:31 AM
Is there a more up-to-date mod that offers this kind of functionality? I did a bit of a search but I didn't find anything.