Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Shorten Bottom [Bit.ly] Details »»
Shorten Bottom [Bit.ly]
Version: 1.00, by LOGECT LOGECT is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 01-03-2011 Last Update: Never Installs: 12
Template Edits
Re-useable Code  
No support by the author.

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:








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.

Screenshots

File Type: png 1.png (23.4 KB, 0 views)
File Type: png 2.png (62.1 KB, 0 views)
File Type: jpg 5.jpg (29.9 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-04-2011, 06:35 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 01-05-2011, 09:13 AM
LOGECT's Avatar
LOGECT LOGECT is offline
 
Join Date: Jun 2010
Location: Copenhagen
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brandon Sheley View Post
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.
Reply With Quote
  #4  
Old 01-06-2011, 12:21 AM
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Posts: 979
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Attached Images
File Type: png 002.png (13.4 KB, 0 views)
File Type: png 003.png (17.5 KB, 0 views)
Reply With Quote
  #5  
Old 01-06-2011, 04:29 PM
LOGECT's Avatar
LOGECT LOGECT is offline
 
Join Date: Jun 2010
Location: Copenhagen
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dr.osamA View Post
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.
Reply With Quote
  #6  
Old 01-07-2011, 01:02 AM
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Posts: 979
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you are welcome bro

thank you for update
Reply With Quote
  #7  
Old 02-28-2011, 06:27 AM
Kingdombuilder's Avatar
Kingdombuilder Kingdombuilder is offline
 
Join Date: Oct 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #8  
Old 02-28-2011, 06:58 AM
BlueCheri's Avatar
BlueCheri BlueCheri is offline
 
Join Date: Jul 2009
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This can be very useful, tagged.
Reply With Quote
  #9  
Old 02-25-2013, 11:16 PM
indie2industry's Avatar
indie2industry indie2industry is offline
 
Join Date: Jan 2008
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be used for o-url.com ?
Reply With Quote
  #10  
Old 02-26-2013, 01:35 AM
datoneer datoneer is offline
 
Join Date: Jul 2011
Posts: 453
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Installed and it works fine
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:04 AM.


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.06273 seconds
  • Memory Usage 2,333KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (5)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete