vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Shorten Bottom [Bit.ly] (https://vborg.vbsupport.ru/showthread.php?t=256493)

LOGECT 01-03-2011 10:00 PM

Shorten Bottom [Bit.ly]
 
1 Attachment(s)
Info :

A simple way to add a shorten bottom for your vBulletin ( bitly shorten url service )


Note:
Of course, you can use this code to any custom template or page ( like Blogs, Cms, Forums and etc )

Screenshots:

https://vborg.vbsupport.ru/attachmen...1&d=1294168217

https://vborg.vbsupport.ru/attachmen...1&d=1294168222

https://vborg.vbsupport.ru/attachmen...1&d=1294174499


Installation:

1- Go to : Admincp>Phrase Manager>Add New Phrase:

Product = vBulletin
Phrase Type = GLOBAL
Varname: vbshorten
Text: Shorten
Save.


2- In the SHOWTHREAD template, Find:
Code:

<h1>
And below that, add this code:

Code:

<a href="javascript:(function(){%20window.open('http://bit.ly/?url='+encodeURIComponent(location.href));%20})();" rel="nofollow"  class="pagetitleinfo textcontrol" >{vb:rawphrase vbshorten}</a>
This is just an example for threads.
and this code works with any version of vBulletin.


All the best.

Brandon Sheley 01-04-2011 06:35 PM

wouldn't you want to place this outside the header tags?
maybe after the </h1> tag
I wouldn't want a bit.ly link in all my h1 tags

nice idea

LOGECT 01-05-2011 09:13 AM

Quote:

Originally Posted by Brandon Sheley (Post 2144059)
wouldn't you want to place this outside the header tags?
maybe after the </h1> tag
I wouldn't want a bit.ly link in all my h1 tags

nice idea

Use this code for any place that you want, that was just an example for threads.

Dr.osamA 01-06-2011 12:21 AM

1 Attachment(s)
Excellent = 5 stars
installed

Note:
I think the reference to missing when adding a new phrase you should choose
Phrase Type = GLOBAL
Product = vBulletin

I chose to add the code to another place after you make changes to code
Become so as it is in the attached photo

my code is:

PHP Code:

<a href="javascript:(function(){%20window.open('http://bit.ly/?url='+encodeURIComponent(location.href));%20})();" rel="nofollow" class="newcontent_textcontrol">{vb:rawphrase vbshorten}</a

and i add it in SHOWTHREAD template .. if you need to do same
find
PHP Code:

    <div id="above_postlist" class="above_postlist">
        <
vb:if condition="$show['largereplybutton']">
            <
a href="newreply.php?{vb:raw session.sessionurl}p={vb:raw LASTPOSTID}&amp;noquote=1" 
class="newcontent_textcontrol" id="newreplylink_top"><vb:if condition="$show['closethread']"><span>+</span> {vb:rawphrase reply_to_thread}<vb:else />{vb:rawphrase closed_thread}</vb:if></a

then add code below that

LOGECT 01-06-2011 04:29 PM

Quote:

Originally Posted by Dr.osamA (Post 2144676)
Excellent = 5 stars
installed

Note:
I think the reference to missing when adding a new phrase you should choose
Phrase Type = GLOBAL
Product = vBulletin

Thanks Dr.osamA, first post updated.

Dr.osamA 01-07-2011 01:02 AM

you are welcome bro

thank you for update

Kingdombuilder 02-28-2011 06:27 AM

This is an awesome mod thank you for your contribution. I have my own url shortener and i would like to use it instead of bit.ly. The shortener is http://www.bfx.me

I tried substituting the URL of bit.ly with bfx.me - it comes up but the url does not automatically go into the field provided. Can anyone help me to get this to work?


Edit:

Well i got it to work a little bit. I found this on the http://bfx.me site:

Code:

Shortening a URL with the bfx.me API is very simple, all you need to do is send a get request to the API passing through the URL you wish to shorten.

To shorten http://www.neowin.net/news/windows-7-piracy-check-update-goes-live request:

http://bfx.me/api.php?u=http://www.neowin.net/news/windows-7-piracy-check-update-goes-live

The API will return the shortened URL http://bfx.me/jZ2qi


To retrieve the original URL from the API, all you need to do is send a get request to the API passing through the shortened URL (or the last 5 characters).

To expand http://bfx.me/jZ2qi request:

http://bfx.me/api.php?r=http://bfx.me/jZ2qi
or http://bfx.me/api.php?r=jZ2qi

The API will return the original URL http://www.neowin.net/news/windows-7-piracy-check-update-goes-live



So I use this:
Code:

http://bfx.me/api.php?u

Instead of this:
Code:

http://bit.ly/?url
It will return the shortened url but will not function the site properly. What I mean by that is if you go to the bfx.me and shorten a url it eill return the shortened url and a barcode as well and will also alow you to tweet the url. From what I did it just comes up as a white screen with the shortened url in the upper left corner. The shortened url is right but I would like it to return to the bfx.me page where it will display the bardcode and the tweet option.

Any help would be appreciated...

BlueCheri 02-28-2011 06:58 AM

This can be very useful, tagged.

indie2industry 02-25-2013 11:16 PM

Can this be used for o-url.com ?

datoneer 02-26-2013 01:35 AM

Thanks. Installed and it works fine


All times are GMT. The time now is 11:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01195 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete