TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 690
  • Total: 690

Block or Article: Social Bookmarks snippet

Started by knat, February 24, 2007, 12:12:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DawnsWebDesigns

It's ok ianus.  I was just telling people what happened.  I probably didn't upload the images. 

But I already added the digg this topic mod.  It works.  So it wasn't worth the trouble to mess with this.  Blogs are more important to me than social bookmarking.  I don't even use most of the stuff myself...I KNOW my family/friends don't.  They won't even use our site.

So Tank don't be offended.  This is surely fine code.  I don't recall uploading any images...so I'm sure it's my fault it didn't work for me.  It's just not worth my trouble.  Most of the snippets/mods aren't worth my trouble.  There's a few I go for every single time.  Less is better.  Less potential for bugs/filled up error logs.  ;)   

knat

I never got offended.. and i wonder why my thread is being highjacked like this.. my snippet can not cause harm to any SMF/TP installation.. it dosnt interact with your database and if you didnt upload the images it would just show you some little red crosses. It can only cause a php error at the worst. And this snippet will act the same way no matter what versions of smf/TP that you are running. Only thing i can imaging is that your php version might not like some of the code..  So cheer up. TP is still the best software for creating nice websites  :)

DawnsWebDesigns

I never saw any X's...I didn't see nothing at all...a blank page.

But I found out my problems are with my host having things (fopen) disabled which makes free simple easy to use software programs basically worthless.  I can't use the feed poster mod or TP's feed blocks.

I've had several hosts over 8/9 years & this is the first that disabled things for security reasons.  Is everybody else ignorant?  Or are they ignoring the security issue & enabling things just to make these softwares work?

So I've either gotta figure out a custom php (heh heh heh...so funny)...or move to an ignorant host for ignorant self-taught do-it-yourselfers like myself.  Anybody know any good ignorant hosts?  Preferably one with a reseller program?

itweb

Code works with my install just great, except for one thing. It shows the domain name as subdomain (it's addon domain on this shared account) which I would like to avoid.

So, it is:

mywebsite.aaaaa.com

instead of

mywebsite.com

Can I get help to fix it?

knat

Quote from: itweb on April 05, 2007, 01:36:17 AM
Code works with my install just great, except for one thing. It shows the domain name as subdomain (it's addon domain on this shared account) which I would like to avoid.

So, it is:

mywebsite.aaaaa.com

instead of

mywebsite.com

Can I get help to fix it?

function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; }
function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }


This bit of code actually graps the current address that the user is viewing when he clicks on one of the social bookmarks.. so if the address is a sub domain it will send that address to the rest of the script.. i did not write this code because php is not a language that i master in any way.. so maybe one of the fine php gurus can help determin how to fix the problem.. all i can say is that it works perfect on my site.. but then again, i dont use a subdomain..

Cheers

knat

itweb

Can we get help from our php gurus, then? :)

IchBin

Well I don't know much about the $_SERVER global, but from what it looks like it is using the current URL you are visiting. I have no idea how you could change it to make it use a different URL than what you are currently viewing.

itweb

Actually, it's grabbing the whole server path. As my domain is an addon, it also grabs the main domain.

Maybe there is a way to show just the current url, instead of server path?

Hendricius


evilopinions

Hi,

I feel this is an excellent snippet/mod you have created...

I have been hunting for this for ages and the one on SMF site did not work with my theme even after modification..

I had to manually submit stories....

I love this mod very much and so do my site members...

Thanks

This website is proudly hosted on Crocweb Cloud Website Hosting.