twitter

Recent Comments

parallels promo code
parallels promo code May 20, 2012 at 9:58PM
Creating A Recent Comments Widget With Disqus's API and PHP

Creating A Recent Comments Widget With Disqus's API and PHP good code pls try

Aaron J. White
Aaron J. White May 11, 2012 at 1:16PM
Using KeePass with Internet Explorer
The file name has to end in .js. So the filename should be URL-In-Title.user.jsMake sure that...
HsN
HsN May 11, 2012 at 11:26AM
Using KeePass with Internet Explorer

By the way, Iam using IE - 9.0.5 and KeePass - 2.19 for at this moment.

HsN
HsN May 11, 2012 at 11:18AM
Using KeePass with Internet Explorer
I followed each step but I am not seing Trixies Options (point 5), even though I restarted my...
Aaron J. White
Aaron J. White May 1, 2012 at 8:00PM
Damien van Holten
Damien van Holten May 1, 2012 at 7:27AM
Creating A Recent Comments Widget With Disqus's API and PHP

Looking at that username, link and generic comment I would say it's a bot.

Aaron J. White
Aaron J. White April 10, 2012 at 6:15AM
Using KeePass with Internet Explorer
Well, I can't recommend anything without a bit more detail. What version of IE are you using?...
Terugbelfunctie
Terugbelfunctie April 10, 2012 at 5:58AM
Using KeePass with Internet Explorer

it did not work for me, done everything as described ??

Aaron J. White
Aaron J. White March 14, 2012 at 10:00AM
Creating A Recent Comments Widget With Disqus's API and PHP

Decision for what? If you don't mind me asking.

USB 3G
USB 3G March 14, 2012 at 2:56AM
Creating A Recent Comments Widget With Disqus's API and PHP
I am really glad I read this article! With this it has really helped me with my...
Aaron J. White
Aaron J. White March 1, 2012 at 1:12PM
Using jQuery and Google Finance to Create a Simple Stock Ticker
Hi akhil. Thanks for your comment. There are a few things wrong with your code though. 1. You...
akhil
akhil February 29, 2012 at 12:31PM
Using jQuery and Google Finance to Create a Simple Stock Ticker
Thanks Aaron for the script. However, the script needs some tweaks for refreshing the price...
David Boyer
David Boyer January 13, 2012 at 4:05AM
Is Your CFLOOP Hogging Memory or Causing OutOfMemory Errors?
Interesting to find that out, wouldn't have expected it to be a problem. I've had similar...
baljit dhanoa
baljit dhanoa January 12, 2012 at 3:08AM
Creating A Recent Comments Widget With Disqus's API and PHP

Creating A Recent Comments Widget With Disqus's API and PHP good code pls try

Posted: November 15th, 2011 - I setup my own url shortener with YOURLS yesterday and everything seems to work perfectly. The only feature I needed that didn't seem to come OOTB is the ability to add a custom prefix or suffix to the url. My short url is http://ajwh.it, and that's good, but in order to put the icing on the cake I wanted to add the letter "e" at the beginning of all of my short urls.

It took me a second to figure out the options available to me, but after a bit of digging I came up with the process below:

**Note: The instructions below are for YOURLS v1.5

1. Install the Random Keywords plugin and activate it

I'm not going to go into the details of how to install the plugin in the post. You can find the directions for installing the plugin here: http://ajwh.it/edf2s
Note: The length of your short will end up being $ozh_random_keyword['length'] + the length of your prefix/suffix.
Also, don't forget to activate the plugin in your YOURLS admin.

2. Open functions.php and modify the yourls_rnd_string function

In the folder where you installed YOURLS open the "function.php" file located in the "includes" folder. Around line 1360 you should see the yourls_rnd_string function. If you want to add a prefix just change the value of $str in the first line of the function. So if you wanted add a prefix of ajw the beginning of your function would look like the example below.

// Generate random string of (int)$length length and type $type (see function for details)
function yourls_rnd_string ( $length = 5, $type = 0, $charlist = '' ) {
$str = 'ajw';
$length = intval( $length );

And that's it! Similarly if you want to add a suffix to all of your newly created short urls then you'll have to modify the $str variable towards the bottom of the function.

$i = 0;
while ($i < $length) {
$str .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
$i++;
}
$str .= 'ajw';
return yourls_apply_filter( 'rnd_string', $str, $length, $type, $charlist );

If anyone knows a better way to do this please let me know. Like I mentioned I have only been using YOURLS for about a day.

P.S. If you haven't already check out the YOURLS Shortener plugin for firefox (http://ajwh.it/e3caz). It's pretty cool.


blog comments powered by Disqus