Skip to content

Multi-User YOURLS Plugin.

NOTA: Plugin desenvolvido com a versão do SVN. Incompatibilidades com versão 1.5+

Um plugin para YOURLS que habilita a possibilidade de multi usuários.

Como funciona:
Habilitando este plugin serão criadas duas novas tabelas no seu banco de dados. Uma para registro de usuários. Outra para manter registro de qual url pertence a qual usuário. O plugin permite que as estátisticas sejam publicas ou privadas (ao dono do dominio e administrador do site). O usuário, sendo dono, pode remover, ou atualizar links (não recomendado, pois urls já divulgadas não serão mais válidas.)

Como instalar:
- Copiar os arquivos do plugin para a pasta /user/plugins/multi-user/
- Acessar area de administração e habilitar o plugin.
- Para acessar página de usuários acessar seusite.com/user/plugins/multi-user (criar link na pagina inicial é recomendado)

Configurações:
Se quizer alterar alguma configuração default, altere seu arquivo de configurações
YOURLS_MULTIUSER_PROTECTED - TRUE/FALSE - Estatisticas são privadas ao administrador e donos da URL encurtada.
YOURLS_DB_TABLE_URL_TO_USER - Tabela que vai armazenar URL para cada USUARIO
YOURLS_DB_TABLE_USERS - Tabela que vai armazenar os USUARIOS
YOURLS_MULTIUSER_CAPTCHA - Habilita CAPTCHA para se registrar.
YOURLS_MULTIUSER_CAPTCHA_PUBLIC_KEY - Public API Key para o Recaptcha, pegue o seu: https://www.google.com/recaptcha/admin/create
YOURLS_MULTIUSER_CAPTCHA_PRIVATE_KEY - Private API Key para Recaptcha.
YOURLS_MULTIUSER_CAPTCHA_THEME - tema ReCAPTCHA.
YOURLS_MULTIUSER_ANONYMOUS - True se usuarios Anonimos podem encurtar URL, false se somente usuarios registrados e logados.

Ajuda: http://forum.matbra.com/

Changelog 1.7 beta:
- Bugs arrumados.

Download:
Multi -user YOURLS Plugin - Versão 1.7 (beta)

Versões anteriores:
Multi-user YOURLs Plugin - Versão 1.6 (beta)
Multi-User YOURLS Plugin - Versão 1.5 (beta)
Multi-User YOURLS Plugin - Versão 1.3 (beta)
Multi-User YOURLS Plugin - Versão 1.0 (beta)

134 Comments

  1. Have another problem that I can't seem to get worked out. Another user posted with same problem too. When you click the pencil to edit the original link it will not let you save. I'm cusious if this is connected to the other problem that is happening. If 2 users try to create a short link with same web address or url you get error. This happens with a special keyword or with no keyword. Please help me get fixed. I'm willing to donate but tight on cash at the moment.

  2. Just a quick follow up. If logged in as admin everything is working fine. It will save the edit and only give error for duplicate keywords. The bug apprears to just be in the multi user. It is probably a simple fix, I'm just missing it. Thank you for the help.

  3. The error this "url" is already in database isn't an error at all. It is a YOURLS Config.php setting.
    Changing This From True To False Fixed the duplicate url issue. define( 'YOURLS_UNIQUE_URLS', false );

  4. Still No Luck On The Editing The Original Url With The Pencil Icon. You Can Change original URL but can't save it. I'll figure it out one day and let you know what I find.

  5. Eric,
    I`m on vacations right now, but give me some time, I will check this problem and solve it asap. Probably on mid Jan.

    Sorry about this problem,
    Matheus

  6. Eric,

    Strange, are you using what YOURLS version? And what plugin version? Just looked to my test system, and tried to edit a link on pencil w/o admin. and it worked. I`m using the multi-user plugin default config, and u?

  7. Matheus,
    Thanks a bunch for the plugin. You are amazing man. I'm pretty sure I downloaded yourls 1.5 but then I added .svn file. I'm completely green to all of this and just learning stuff. I'm using default config with multi user too. Except I added define( ‘YOURLS_UNIQUE_URLS’, false ); to allow each user to create the same url more than once. The save feature wasn't working prior. I was thinking about maybe doing a clean install again with maybe different versions and see what happens. If you download from like http://code.google.com/p/yourls/downloads/list it is different than here http://yourls.googlecode.com/svn/trunk/ I thing I used something called tortoise to get the svn file and then uploaded it. Everything works great except pencil and saving the changed url. I'm gonna try to work on it tomorrow some and see if I can figure out the difference between admin and multi user. Hope you have a great vacation. Thanks for checkin on it when you get a chance. I run the new shortner on http://www.rqc.me for memebers of my website to use for tracking their qr codes and links in ads etc.

  8. I forgot multi user version. The latest one is what I'm using 1.6 beta version.

  9. Eric,

    Thanks for the information. I'm checking, I don't know why, but when I checked the ajax request, on my system, I receive an answer, on yours I receive "data is null". I still don't understand why. I'm thinking can you change your config password, and other personal information, zip all your YOURLS files and send to me? I will try to make a diff compare to discover what is going on.

  10. Hey great plugin. I just tested it but came across some bugs that I'd like to notify you of: When saving shortcuts via an external client (e.g. I used Urly for Android) they are stored in the administrator's database but not in the user's database. In fact shortcuts are created and saved in the database with ANY RANDOM TOKEN/API-KEY! I am not sure if that's actually a problem with the core or your plugin. Can you confirm my observation and if yes: Can it be fixed?

  11. Me again… I also get this message when refreshing the screen. Maybe the info helps:
    Fatal error: Call to undefined function yourls_string2htmlid() in /path/to/yourls/user/plugins/multi-user/mufunctions.php on line 174

  12. Mohamed Mohamed

    Hello Support,

    I have downloaded the Multi-user plugin for Yourls and installed. It is working fine. I am using yourls v1.5 ( you have mentioned multi-user incompatible with yourls v1.5).
    Please let me know when you have next stable release.
    awaiting for the response.

  13. Thanks, I'll get the files sent over this week I hope.

  14. Yasirli Yasirli

    how about a link to "Forgot Your Password" ? lot of old people in this word 🙂 , may be you can create it also

  15. Mohamed,

    This it isn't a support. It is me, the programmer. lol. I don't guarantee it is working with 1.5 but if you say. I'm waiting to YOURLs to release the next version to release multi-user stable release.

  16. KeyJey KeyJey

    Helo Matheus, you say in one reply here:

    Hello VBk,

    You need to comment this line:
    //yourls_maybe_require_auth();

    But I don't know what is the config file and the path of it so make this configs, can you help me please?

    Thanks.

  17. Matheus,

    Maybe the smartest person I know. Thanks for your multi user plugin. Thanks for supporting your products too. You fixed the edit url by user and I seriously can not thank you enough. Wishing you and your family the best in 2012. Hope we can work together on something big in the future. You are a genius.

    Thank you,
    Eric

  18. Eric,
    Really thanks for your report and for all time that you spent helping me. I wish to you and your family the best 2012 too!
    Keep in touch,
    Matheus

  19. Dan Dan

    will this be updated for 1.5?

  20. Hello Dan,

    Probably not. I don't intend to fix this plugin to work with older versions, but with the new ones I have plans. Sorry.

    Best Regards,
    Matheus

  21. How do I put conditioner in my hair before I swim and still keep my swim cap on?I had an asthma attack at swim practice and I'm afraid to go back. Should I go or wait until I start meds?

  22. Paul Paul

    Hi Matheus, your script is really good! Thanks taking the time and share your work.

    One question, i got a custom cms with the users table and i would like to show stats based on user/short url.

    How can i achieve this withh your plugin?

  23. Excellent plugin, thank you.

    Do you know how to modify the htaccess file to allow a nicer URL than '/user/plugins/multi-user/' please?

    I would like to use http://yi.tl/u/ for my user admin area instead of http://yi.tl/user/plugins/multi-user.

    However, no matter what I try, I can't get the htaccess file to cooperate. Any help would be appreciated, thank you.

  24. Hello Anthony,
    Have you tried to create a symbolic link to /u/ to /user/plugins/multiuser-user?

    If no try to create one, and you will need to add
    "!-l" on your RewriteCond to make sure that you don't redirect /u/. I think it should work.

    Best Regards

  25. Great suggestion, thank you. For anyone else wanting to implement this:

    1. Open .htaccess and add the following with the other conditions:
    RewriteCond %{REQUEST_FILENAME} !-l

    2. Open up your UNIX shell and run something like this:

    ln -s /usr/www/users/MYACCOUNT/MYDOMAIN/user/plugins/multi-user /usr/www/users/MYACCOUNT/MYDOMAIN/u

    Don't use trailing slashes for the folder names.

  26. @Anthony Thanks, that worked wonderfully.

    @Matheus I am running into the following error:
    Fatal error: Call to undefined function yourls_string2htmlid() in /home/utau/public_html/go/user/plugins/multi-user/mufunctions.php on line 174

    I am using the 1.7 Beta. Also had issues registering on the forum. I guess it didn't like my IP address or something?

  27. Hey Hentai,

    Strange. I didn't try the 1.7 beta version. I'm waiting for the next stable release to fix everything, it is hard to keep my plugin following the SVN version, because if I get rev XYZ for example and you get XYZ+1 maybe the plugin will not work. Sorry about that.

    Uhm, strange... a few weeks ago I was under a bot attack so now, I put some captache verification, password strong and this kind of stuff, but blockeds ip no. Did you checked the box right below the banner reporting the error?

  28. When I activate multi user, then login as a user (after signing up), none of the URLs are listed. Am I missing something here?

  29. Thank you for the reply.

    Right. Did all that, but when I login to the user page where the URLs are supposed to be listed, nothing appears. Other people are having this problem too. It shows the URL stats for that user, but does not list the short url or any thing.
    SO, if I sign in, log in, short some URL all is fine. BUT, if I try to go back later to see stats, and if I login as user, nothing appears in the URL listing.

  30. Kirt,

    I remember that I already fixed this problem. I just don't remember how. What YOURLS version are u using? What is your configuration? What multiuser version? What is your php version?
    Can you use http://forum.matbra.com so we can talk?

  31. Wayne Wayne

    What version of YOURLS will this work with?
    The latest seem to be 1.5 the SVN version you mentioned, it that before or after 1.5

    Thank you

  32. Hello!

    If someone tries to shorten a URL that another user had already shortened, then tries to delete it, will the URL be deleted? Or no?

    Also, I was wondering... I need a plugin that would allow me to block specific domains from being shortened. I Can you make one like this?

  33. Wayne Wayne

    Thank you Matheus

    I figured it and it's working great.

    Great Job

  34. Thanks for your great plugin

    if(!defined('YOURLS_MULTIUSER_CAPTCHA_PUBLIC_KEY')) {
    define('YOURLS_MULTIUSER_CAPTCHA', "mykey");
    }
    is this the way to give the key?

  35. Sundar,

    This way it will work, but it is not the correct way. The correct way is edit your confi file usually user/config.php and add the line define('YOURLS_MULTIUSER_CAPTCHA', 'your_key');
    Thanks.

  36. super and great work man

    it works like nothing.

    thanks for support.

  37. Hello!

    I was wondering...

    A.) I had a lot of already shortened URL's on my YOURLS before adding your plugin. Can I associate different URL's to different users?

    B.) Can I make one of my users an admin?

    Thanks!

  38. Oh...

    C.) my install is one where there is one unique Short URL for one unique long URL. (Default YOURLS setting. Not like Bit.ly) If one user "deletes" a URL that another user has (tried) to shorten, does that first user delete the URL for everyone, or just him?

  39. Hello,

    A) If you add plugin with a lot of shortned URLS, you can associate but you will need to this by hand. So if you want all old URLS to be yours it is easy, otherwise, can be hard.

    B) Right now the Website ADMIN and Users are separated, but when you enable the plugin the system will create a Multi-User with the same info as your ADMIN.

    C) ON DELETE we just remove the data that says that some KEYWORD belongs to a SPECIFIC user. So if you have AAA pointing to google.com and I have BBB pointing to google.com and you delete your AAA, multi-user will remove AAA from your account and YOURLS will take care of the rest. YOURLs works with keywords so it will remove AAA and I still have my BBB pointing to google.com.

    PS: Remember to backup your database! We are in BETA and waiting for bugs reports. YOU are the responsible, we do NOT guarantee anything.

    Best Regards and Enjoy!
    Matheus

  40. "There are incompatibilities with 1.5 version"

    What incompatibilities you are talking about?

    Thanks
    Simone

  41. I'm not sure, I developed it under a SVN version not to the old 1.5 version, but I received a lot of messages saying that is not working with 1.5 and I'm not going to code it to 1.5, I'm waiting the next release

  42. Steven Steven

    When user login in it says your token number is. What is that? How do I remove it?

  43. If user want to use the YOURLS api as a logged user it could use his token. If you want to remove edit admin.php (from multi-user folder) and find the line "Your token..." and remove it. 😀

  44. Marcel Marcel

    Hi! your plugin is great! your script is really good! Thanks taking the time and sharing your work.

    As somebody else asked before user integrations, I would really like to auto register YOURLS multi-users from Buddypress members via the YOURLS: WordPress to Twitter plugin, basically writing the YOURLS users table and assigning the same short url to that user from the short URL keyword from which the plugin creates a new link on YOURLS.

    The idea behind it is to show stats based on WordPress user/short url

    How could this be achieved this with your plugin?? all the best!

  45. Hello Marcel,

    It is possible to change it to do what you want, if I understand correctly, you want to create a page that the creator user and short id will be the same, am I right?

    If yes, to do this we need some modifications to the plugin for example, when creating a URL via API calls it creates a new user and associate to it. (I'm not exactly sure if I understand correctly)

    But I don't see the point of doing this, you will create a URL per USER always? So why don't you just create the short URL? The problem is tracking it back to which page created it?

  46. Marcel Marcel

    Hi Matheus! thanks for your prompt response. Yes, you understand it correctly, the thing is, I want to associate the same WP username with the YOURLS Multi-user name, so each WP user can have his own account in YOURLS. I thought and easy way to do it was via the YOURLS: WP to Twitter plugin, which already creates a short link from the Buddypress nice_name, which re-directs to the WP user Profile page.

  47. Hey Marcel,

    So you want that all users from WP has an account inside YOURL's and create short links to WP post associate to the WP post author?

    I don't think it is that easy to use that plugin, that plugin will just create a shortned url to the WP user Profile, if that is what you want, you can use the plugin that already do this.

    It is possible to do what you want, but or your WP will need to update YOURL's database (ugly) or we will need to add an API to user creation. That is not available now and I'm not exactly sure if I will do it. (as I told other guys, i don't make money from this plugin, so I can put a lot of my time on it)

    If you need that really bad maybe we can figure something out.

    Have a good one!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.