News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Add Sitepreviews to posted urls

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

Previous topic - Next topic

Marook

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 !
SMF Rulez ;) | Meet me home ! | My Mods

miregrobar


slackerpunk

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

Marook

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
SMF Rulez ;) | Meet me home ! | My Mods

Fallen Angel

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????

Marook

 I'll fix it asap but i must know whats happening when you post a youtube video...
SMF Rulez ;) | Meet me home ! | My Mods

perro88

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

Fallen Angel

#67
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..................  ;)

Fallen Angel

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...............

perro88

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.

microbone

#70
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 [nofollow] 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 [nofollow] 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 :)

Sabre™

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.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Marook

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...
SMF Rulez ;) | Meet me home ! | My Mods

microbone

#73
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 [nofollow]
sitepreview_bubble   White

I have:
sitepreview_select   5
sitepreview_bubble   1

Marook

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...
SMF Rulez ;) | Meet me home ! | My Mods

microbone

#75
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.

perro88

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

Sabre™

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??
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Marook

@ fernside : right, you need the latest...

you have to call the function sitepreviews() in the index.template.php before the </head> tag...
SMF Rulez ;) | Meet me home ! | My Mods

Trinny

Awesome mod, easily installed and works perfectly. Thank you.

Advertisement: