Apr 15 2011

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)

Comentários do Facebook:

121 Comments

  • By Paul, May 11, 2011 @ 3:46 pm

    WOW! Really great plugin!!

    One answer:
    Is it possible for the users to use api?

    thank you!

  • By Paul, May 12, 2011 @ 6:41 am

    The statistic page for a short link is only available if I logged in. If I call the statistics when I'm logged off I get the error:

    Fatal error: Call to undefined function yourls_get_request() in /var/www/.../user/plugins/multi-user/infos.php on line 12

    What can I do?

  • By Matheus (X-warrior) Bratfisch, May 12, 2011 @ 1:12 pm

    Hello Paul,
    As a safety question I did this:
    - admin can use all API
    - expand and shorturl can be used by anyone
    if you are logged or use your hashcode (generated when you signup) the shortened link will go to your account.
    - stats, db-stats and url-stats can be accessed if your YOURLS_MULTUSER_PROTECTED is false
    - if YOURLS_MULTUSER_PROTECTED is true, only the owner can get the shortened status
    Did you get it?

  • By Matheus (X-warrior) Bratfisch, May 12, 2011 @ 1:21 pm

    Your second problem, I tried to reproduce but I couldn't.
    For example, my system have YOURLS_MULTI_USER as TRUE.
    If I'm logged out and try to access some stats as myweb.com/f+ I can't see it, and go to main page, if I'm logged in I can see it.

    Can you show me your webpage? If you want to contact me by e-mail at matheusbrat [AT] gmail [DOT] com and we can try to figure out this problem.

  • By VBk, June 17, 2011 @ 11:31 am

    Matheus ,

    I was looking for the 'Registration " feature and your plugin is a great and more advanced

    I found an issue with pages :http://mydomain/com/user/plugins/ and http://mydomain/com/user/ . These is showing all the links and looks like something un-necessary . Is the only solution is edit and customize the core files to change the look of the pages are hide them?

    >- Comment (//) the second line of yourls-api.php file.

    AM I need to Comment this line : //define('YOURLS_API', true); ...?

    I am unsure about the advanced setup you explained here : If you want something different than default setup, achange your config file. Could you please write a guide about them?

    Thanks !

  • By VBk, June 17, 2011 @ 11:48 am

    Matheus ,

    Another thing...site.com/yourls-api.php is not accessible by anonymous users or the registered users.

    I use my Yourls installation with third party services like Tweetdeck and my own wordPress installation (using WordPress plugin). Does the Yourls Site works with those third party services if the API is inaccessible?

    Thank you!

  • By Eyal, June 20, 2011 @ 11:33 am

    Thanks for the plugin,
    There is one major issue I have spotted.. different users will share the same statistics in case they shorten the same URL..
    In addition.. the lack of API support is quite problematic..

  • By Eyal, June 20, 2011 @ 11:44 am

    last comment was reffered to the YOURLS_UNIQUE_URLS = true

  • By Matheus (X-warrior) Bratfisch, June 20, 2011 @ 1:15 pm

    Hello VBk,

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

    If you want a advanced config you have to edit /user/config.php
    But I think you want the default installation config.

    The api is not accessible by anonymous user. But, if you're a registered user you can access it. When a user is registered the system generate a random TOKEN to use in the api. To access it, you have to do your request to api using yourls-api.php?XYZ&token=YOUR_TOKEN

    You must replace XYZ with the parameters of your api request parameters.

    Like I said, you can access the api as a registered user using your token, but most of the Third part services don't have an option to add the TOKEN as a parameters. So you will need to hack your tweetdeck, or wordpress to use it.

    For example, I'm using wp to twitter in my WordPress account, to enable it to use my token I edited wp-to-twitter.php, and edit the remote request parameters.

    In this row, I add the token feature, so the requests from my wp-to-twitter goes to my account.

    $api_url = sprintf( get_option('yourlsurl') . '?username=%s&password=%s&url=%s&format=json&action=shorturl&keyword=%s&token=a4da7a419aabf00753862614da7a419aabfd333760469',$yourlslogin, $yourlsapi, $thispostlink, $keyword_format );

    Best Regards,
    Matheus

  • By Matheus (X-warrior) Bratfisch, June 20, 2011 @ 1:19 pm

    Eyal,

    Yes I guess so. The users will share it. I didn't think a way that is "correct" when this happens, so this is the normal behaviour, if I'm not wrong there is some kind of option of yourls that you can define if multiple shortened urls to the same URL will be the same stats or not.

    I'm not sure about this right now, I will try to think more about it in the next days.

    Thanks for your comment,
    Matheus

  • By VBK, July 2, 2011 @ 10:33 am

    Matheus ,

    I have a feature request and hope you would implement it
    -"About Token key display in Admin panel"

    A user can view the token only during signup . He can't use the key if he forgot to retrieve it during signup. So it is convenient to users if they have change to note it down from Admin panel.

    Thank you !

  • By VBK, July 2, 2011 @ 10:35 am

    Regarding my previous question...I have followup questions and posted in this wiki-page for easy understanding.

    This is the URL http://doowikis.com/m/NDkZ4T1xVx and feel free to edit the page with your message

    Please let me know if you want me to post the question directly in this blog. But I feel it is convenient there

    Thanks !

  • By Matheus (X-warrior) Bratfisch, July 2, 2011 @ 3:39 pm

    I agree with your previus question, it will be nice to display the user token.

    Actually I'm still thinking about the future of this plugin. Because, if you see in the roadmap of YOURLs. Ozh intend to develop all this features on the core of the YOURLS so I'm not sure if it's a good stuff to keep the dev of this plugin. Because it will become obsolete.

    But I really appreciate your feedbacks. Really thanks,
    Matheus

  • By VBK, July 2, 2011 @ 11:30 pm

    Matheus ,

    >Actually I’m still thinking about the future of this plugin.

    You are right ! I am closely observing the Yourls updates for several months. I think Ozh will take much time to realease the version with Multiuser support. According to the Road map the next version will be 1.6 and I think it will take at-least 1 month

    After that the next version may be released in 4-6 months(He mentioned Version Undecided. So that may take several months). Until then the Yourls Users can use your plugin and you can influence Yourls users. Who knows ...? May be ozh would ask you to join him for implementing the feature in Core.

    Also you may get more Ideas other than the Multi-user support. So if you have a perfect forum and run a separate site for Your plugins, you will definitely get a good response and you need not worry about a single plugin's future. You may create other plugins like WordPress and yourls Integration(Full integration), Drupals + Yourls Integration and more.

    Sorry ...if I crossed limits to suggest these. I just wanted to encourage a good developer who made a " Multi-user " feature possible

    I can help you to run the forum. I can create a forum on my own server to honor you

    Thanks !

  • By VBK, July 2, 2011 @ 11:44 pm

    Sorry for the another post. I found a problem

    Bug report :

    The stats of ShortURLs and other details are disappearing on browser refresh . I mean to say that the user-Admin pages are not showing up details as earlier

    Also replied to wiki's question -http://doowikis.com/m/NDkZ4T1xVx

    Thanks !

  • By Matheus (X-warrior) Bratfisch, July 3, 2011 @ 8:27 pm

    VBK,

    You motivated me to develop a little bit more and create the forum. You can access it on http://forum.matbra.com

    I will use the forum to other PLUGINS, PROGRAMS, STUFFS that I create.

    And I just released a new version with some minor fixes.

    About your last "BUG", I didn't get it and I can't reproduce it here. Please explain how to reproduce the bug.

    Best Regards,
    Matheus

  • By VBK, July 6, 2011 @ 1:00 am

    Matheus ,

    Sorry for delay! These are the screen shots of the Bug I mentioned ( On user's dashboard):

    http://imgur.com/7MqPW
    http://i.imgur.com/QEFRt.png and
    http://i.imgur.com/rTMZo.png

    Thanks !

  • By VBK, July 8, 2011 @ 1:01 am

    Matheus ,

    I have replied to your last comment and submitted some screenshots for that

    I think the response was caught under Moderation. Could you please check that?

  • By Matheus (X-warrior) Bratfisch, July 8, 2011 @ 1:21 am

    Hello VBK,

    I understand what is happening, but I can't reproduce it. I created a shortened link, logged in my account... than create other, wait a few time and refreshed... and both are there. I also checked on admin dashboard and all the links were there.

    I can't figure out why this is happening. Can you give me access to your server as a user so I can try it by myself?

    Best Regards,
    Matheus

    PS: Let's try to use the forum.

  • By pks ichn, July 8, 2011 @ 9:46 pm

    yes, similiar to VBK when i refresh i lost the urls!

  • By Matheus (X-warrior) Bratfisch, July 8, 2011 @ 9:49 pm

    Pks ichn,

    Can you please give me access as a user to your service? I can`t get this problem here. Maybe it is a config problem.

    Best Regards,
    Matheus

  • By Matheus (X-warrior) Bratfisch, July 15, 2011 @ 4:30 am

    Pks Ichn,

    It seems to be a incompatibility problem with YOURLS 1.5. Try using the SVN Version please.

    Best Regards,
    Matheus

  • By MadMakz, September 16, 2011 @ 9:19 am

    Hey there.
    I get an "Input error: k: Format of site key was invalid" error on signup page.

    define('YOURLS_MULTIUSER_CAPTCHA', false);

    And thus nobody can register while it fails to verify the non existant captcha:

    "Captch is incorrect."

    Using latest Yourls trunk r691 (1.5.1-gamma).

  • By Matheus (X-warrior) Bratfisch, September 16, 2011 @ 12:30 pm

    Hello MadMakz,

    There is a bug right now. I'm still checking the config combinations to verify if everything is working. Probably Monday I will release a new version. For now, if you want to fix it, open mufunctions.php look for captchaEnabled and replace this line
    -
    if(defined('YOURLS_MULTIUSER_CAPTCHA') && (YOURLS_MULTIUSER_CAPTCHA_PRIVATE_KEY != 1) && (YOURLS_MULTIUSER_CAPTCHA_THEME != 1))
    -
    FOR THIS ONE
    -
    if(defined('YOURLS_MULTIUSER_CAPTCHA') && (YOURLS_MULTIUSER_CAPTCHA == true))
    -

  • By MadMakz, September 16, 2011 @ 1:55 pm

    Working perfect now. Thanks! :)

  • By DirkE, September 29, 2011 @ 12:33 pm

    Hello Matheus,

    I am testing your multi-user plugin. It looks like that wat I want, but I do have some touble with it:
    After adding the second url or after edding the first I receive only the counter :
    "Display 1 to 3 of 3 URLs , counting 0 click ."
    And an error: "Fatal error: Call to undefined function yourls_string2htmlid() in /srv/www/htdocs/xxxx/html/yyyy/rd/user/plugins/multi-user/mufunctions.php on line 174".
    Can you help me to solve it?

  • By DirkE, September 30, 2011 @ 7:30 pm

    Hello Matheus,
    I think that Ih have found out something about my problem: Your are using the functions-formatting.php and in new installations it is not in the package. Also I think, that the sql handling of the multi-user plugin does not work correctky: To many open queries to the database?
    It would be great, if you can have a look on your source, because Im still learning php ...

  • By Matheus (X-warrior) Bratfisch, September 30, 2011 @ 8:00 pm

    Hello Dirke,

    I can take a look on the source code. What version of YOURLS are you using? You MUST have the SVN version the latest stable release it is not compatible with the plugin. What is your shortener address?

  • By DirkE, October 1, 2011 @ 6:18 am

    Hello Matheus,
    thank you ... that was the answer! I just did use the false release! After installing the SVN-Version everything was fine! Thank you for your plugin!!!
    One feature I am searching for is how to include your frontend into wordpress. My installation is running in a subdirectory from wordpress. I have already the .htaccess modified to redirect to a special yourls_loader2.php to redirect everything fine. Now I would like to implement the frontends in WP but I do not have any idea how? Maybe you have a tipp for me?

  • By Bob, October 2, 2011 @ 11:38 pm

    Hi, Matheus...

    Do you have any plans to update the plugin for compatibility with the 1.5 version of yourls? I installed yourls 1.5 before noticing your note on compatibility.

    I haven't looked at yourls 1.4 yet, so maybe it will work for me.

    BTW-- The post timestamps in your blog are broken: "%A %B %e%q, %Y @ %I:%M %p"

    Thanks!

  • By Bob, October 2, 2011 @ 11:41 pm

    Sorry-- It's just the post timestamps in the English version of the blog that are are broken...

  • By Matheus (X-warrior) Bratfisch, October 3, 2011 @ 12:22 pm

    Hello Dirke,

    I'm not sure if I understand what you want. You want to short your wordpress URL automatically and send it to social networks?

  • By Matheus (X-warrior) Bratfisch, October 3, 2011 @ 12:26 pm

    Hello Bob,

    Actually I don't have any plans, when I start developing the plugin I thought the next version of YOURLS will be released soon so I did with the SVN version. I do not intend to dev it to version 1.5. It should not work with 1.4 too and any older releases. You can try to update your files of YOURLS to the SVN ones keeping the database and try if it works (I'm not sure, but I think the database structure is the same so there is no problem). If this works just install the plugin.
    Yeah, I know about this date issue but it is a plugin problem and I'm not really in the mood right now to learn the plugin code and fix it.
    Thanks!

  • By DirkE, October 4, 2011 @ 10:55 am

    Hello Matheus,

    I want to integrate your multi-user/index.php-functionality into a page from my blog. (My dream would be, to use the User-Login from wordpress instead of yours...).

  • By Lasse, November 21, 2011 @ 12:22 pm

    Damn good plugin. But shame you don'T develope any further with captcha function. Right now teh captcha is teh only thing badly missing to get to work ;-(

  • By Matheus (X-warrior) Bratfisch, November 21, 2011 @ 1:34 pm

    Hey Lasse,

    Where do you want a CAPTCHA function? Actually multi-user have a CAPTCHA function using re-captcha.
    VARIABLES:
    YOURLS_MULTIUSER_CAPTCHA – Enable user CAPTCHA to Sign in.
    YOURLS_MULTIUSER_CAPTCHA_PUBLIC_KEY – Public API Key to Recaptcha, get yours: https://www.google.com/recaptcha/admin/create
    YOURLS_MULTIUSER_CAPTCHA_PRIVATE_KEY – Private API Key to Recaptcha.
    YOURLS_MULTIUSER_CAPTCHA_THEME – ReCAPTCHA theme.

  • By Lasse, November 23, 2011 @ 10:57 pm

    Thanks i got it working!!

    Another thing i have to deal with is:
    i can only edit links as admin.
    If a normal user is logged in, he can click
    to edit the link and keyword, but if he clicks "save" nothing happens. Just frozen and you can't click "X" for close, because it is disabled. Any idea how to fix it?

  • By Matheus (X-warrior) Bratfisch, November 25, 2011 @ 3:52 pm

    Any idea. I'm not sure if i understand. But I will try to reproduce what I understand and I will reply to you again here.

    Best Regards,
    Matheus

  • By Lasse, November 28, 2011 @ 12:23 pm

    Hi Matheus,
    thank you for your fast replies!

    Just one more question! I want to check within
    mufunctions.php if the user is already logged in
    in the site.com/admin area. I tried this:

    if ( YOURLS_ADMIN == true )
    {
    //--ok we are logged in as admin
    }

    But for some reason i can't get it to work.
    Do i have to include or call something else before in mufunctions, to get access to this information?

  • By Joe, December 14, 2011 @ 10:25 pm

    yourls seems to be the best and most reputable free url shortnerer script out there. this mulit-user plugin seems more than needed but i don't know how i should proceed... after reading this thread i can't figure out if the plugin works or not AND NOW there's discussion as to whether yourls will incorporate a multi-user feature in a future release. any advise? i'd hate to embrace this plugin, struggle with it then roll out my site if it even works then only to create a mojor gaff with my users because of a yourls update making this plugin obsolete.

  • By Bernhard, December 15, 2011 @ 12:24 pm

    At least in my environment the plugin (although activated without problems) didn't run into the tryToInstall() function and thus didn't create the necessary db tables because the yourls_add_action method was called with activated_multi-user instead of activated_Multi-user (note the uppercase M).

    Hope this helps.

  • By Aman Arora, December 17, 2011 @ 2:39 pm

    Where is the config file located?

  • By Joe, December 19, 2011 @ 8:34 pm

    does the default setup even work?? if not please provide step by step instructions. do i have to edit the config file in order for it to work? why not a simple readme file, do you even provide support for this plugin?

  • By Matheus (X-warrior) Bratfisch, December 19, 2011 @ 9:12 pm

    Lasse,
    First of all, I tried to reproduce your problem with edit and save and I didn't have problem. :(

    To check if someone is logged in as admin you must use "yourls_is_valid_user();" it returns true if it is admin false if it is not.

  • By Matheus (X-warrior) Bratfisch, December 19, 2011 @ 9:17 pm

    Joe,

    I'm trying to keep the plugin update, but while I don't make any money with the website/plugin I can't guarantee the future of it. But I want to keep it update.

    If you look at YOURLS roadmap, you can see on "Future Features" this "User management (multi user, user roles, no more plain text passwords in config file)".

    But the YOURLS is on version 1.5 since Nov, 2010. So I'm not sure when/if this feature will be available on YOURLs.

  • By Matheus (X-warrior) Bratfisch, December 19, 2011 @ 9:18 pm

    Bernhard,

    I think this mistake is correct some time ago. Just retried to install and didn't have this problem.

  • By Matheus (X-warrior) Bratfisch, December 19, 2011 @ 9:19 pm

    Aman,

    The config file is the same that you use on YOURLS. Mine is located on user/config.php

  • By Matheus (X-warrior) Bratfisch, December 19, 2011 @ 9:23 pm

    Joe,
    Sorry to take so long to answer your question, I just released a version 1.6 beta where everything is supposed to work. Just tried the setup without any configuration and it works for me.
    I provide support to plugin when I have time, as I said to others, I don't make any money on it, so I can't guarantee that I will spend a lot of time giving support. If someone wants special support/dev, can contact me so we can talk.
    If I start making money on my personal projects, I will start give them more time, otherwise, I can't because sadly I still need to pay my bills.

  • By Joe, December 19, 2011 @ 10:04 pm

    understandable. i'd be willing to make a contribution if it works, i'll give it try.

    maybe i can encourage others to do the same.

    thanks for the fast reply

    give us a link to your other projects!

  • By Eric Binkley, December 21, 2011 @ 4:17 pm

    Thank you so much for this plugin. I need a little help please. When multiple users try to create the same url for instance http://rapidqrcodes.com/order if another user has already create you get the error this http://rapidqrcodes.com/order is already in the database. How do I correct this so that each user can still create a new short url for thei tracking purposes. Thank you. If you need to login to see for yourself email me and I'll give you a login name to get to members area.

  • By Eric, December 24, 2011 @ 6:54 am

    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.

  • By Eric, December 24, 2011 @ 7:17 am

    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.

  • By Eric Binkley, December 28, 2011 @ 8:11 pm

    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 );

  • By Eric Binkley, December 28, 2011 @ 8:12 pm

    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.

  • By Matheus (X-warrior) Bratfisch, December 30, 2011 @ 3:34 pm

    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

  • By Matheus (X-warrior) Bratfisch, December 30, 2011 @ 3:41 pm

    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?

  • By Eric, January 2, 2012 @ 3:39 am

    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.

  • By Eric, January 2, 2012 @ 3:52 am

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

  • By Matheus (X-warrior) Bratfisch, January 2, 2012 @ 3:17 pm

    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.

  • By moontan, January 4, 2012 @ 4:49 pm

    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?

  • By moontan, January 5, 2012 @ 6:28 am

    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

  • By Mohamed, January 12, 2012 @ 7:02 am

    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.

  • By ERIC, January 17, 2012 @ 8:46 pm

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

  • By Yasirli, January 21, 2012 @ 3:31 pm

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

  • By Matheus (X-warrior) Bratfisch, January 27, 2012 @ 10:36 pm

    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.

  • By Matheus (X-warrior) Bratfisch, January 27, 2012 @ 10:37 pm

    Yasirli,

    I need to write down the idea! Thanks!

  • By KeyJey, February 3, 2012 @ 2:44 pm

    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.

  • By Eric, February 11, 2012 @ 5:01 am

    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

  • By Matheus (X-warrior) Bratfisch, February 11, 2012 @ 5:14 am

    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

  • By Dan, March 21, 2012 @ 1:56 pm

    will this be updated for 1.5?

  • By Matheus (X-warrior) Bratfisch, March 21, 2012 @ 2:03 pm

    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

  • By CrakTrealry, April 22, 2012 @ 12:02 pm

    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?

  • By Paul, April 25, 2012 @ 5:55 am

    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?

  • By Anthony, May 8, 2012 @ 3:54 pm

    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.

  • By Matheus (X-warrior) Bratfisch, May 9, 2012 @ 10:03 am

    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

  • By Anthony, May 10, 2012 @ 7:16 am

    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.

  • By Hentai, May 18, 2012 @ 6:04 am

    @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?

  • By Matheus (X-warrior) Bratfisch, May 18, 2012 @ 1:39 pm

    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?

  • By Kirt Cathey, May 30, 2012 @ 8:44 am

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

  • By Matheus (X-warrior) Bratfisch, May 30, 2012 @ 11:58 am

    Sign in, Log in, short some url and check the urls. Got it?

  • By Kirt Cathey, May 30, 2012 @ 4:21 pm

    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.

  • By Matheus (X-warrior) Bratfisch, May 30, 2012 @ 4:52 pm

    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?

  • By Wayne, June 8, 2012 @ 2:06 am

    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

  • By Matheus (X-warrior) Bratfisch, June 12, 2012 @ 12:53 pm

    Wayne,

    It is 1.5+. You can get the snapshot that I used on http://www.matbra.com/?attachment_id=1170

    Best Regards

  • By pgrytdal, June 19, 2012 @ 9:37 pm

    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?

  • By Wayne, June 19, 2012 @ 9:58 pm

    Thank you Matheus

    I figured it and it's working great.

    Great Job

  • By Sundar, August 2, 2012 @ 1:37 pm

    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?

  • By Matheus (X-warrior) Bratfisch, August 2, 2012 @ 1:46 pm

    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.

  • By Sundar, August 7, 2012 @ 10:22 am

    super and great work man

    it works like nothing.

    thanks for support.

  • By pgrytdal, September 5, 2012 @ 3:15 pm

    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!

  • By pgrytdal, September 5, 2012 @ 3:18 pm

    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?

  • By Matheus (X-warrior) Bratfisch, September 5, 2012 @ 3:27 pm

    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

  • By Simone Freelance, November 2, 2012 @ 9:36 am

    "There are incompatibilities with 1.5 version"

    What incompatibilities you are talking about?

    Thanks
    Simone

  • By Matheus (X-warrior) Bratfisch, November 2, 2012 @ 11:05 am

    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

  • By Steven, December 20, 2012 @ 9:37 am

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

  • By Matheus (X-warrior) Bratfisch, December 20, 2012 @ 12:01 pm

    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. :D

  • By Marcel, March 8, 2013 @ 7:45 am

    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!

  • By Matheus (X-warrior) Bratfisch, March 13, 2013 @ 1:44 am

    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?

  • By Marcel, March 15, 2013 @ 7:02 am

    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.

  • By Matheus (X-warrior) Bratfisch, March 19, 2013 @ 8:24 pm

    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!

  • By Tom, March 23, 2013 @ 5:31 am

    Hi

    First - Great Plugin !

    Puzzled: If I am logged in as Admin and I also log in as a user. The user account when viewing stats has a link to the admin??? Is it reading my IP and knows that "the user" in this case is also the admin? Otherwise that appears to be a problem.

    I am also getting the problem where the user can not "edit", instead I get (firewall?) message "if I want to open or save admin-ajax.php" The user can edit for a short time, but if they leave the page ie. to view stats and then try to edit...they can't. Instead it wants to open or save admin-ajax.php which is blank when you choose open.

    YOURLS v 1.6-polyglot

    BTW. I know it near impossible to keep multi-user working with every tweek of svn and I don't care which version I run as long as multi-user works with it. Do you have or point me to a link of a zipped version that multi-user is compatible with. What about the current version (non svn) 1.5.1?

    Thanks
    Tom

  • By Chris, July 15, 2013 @ 10:38 pm

    I'm encountering a problem with reCaptcha. From what I can tell, it's working, outside of the new user is not being added to the database. Let me explain.

    Captcha shows up in the form properly.
    I fill out user name / password / captcha.
    When I hit submit, all fields are cleared, a new captcha appears, and the form is redisplayed.
    I check the database, and the user name/password has not been added.

    Doing some error checking, if I enter a wrong captcha, I get a valid error response.

    I added an echo statement in, put the correct captcha in, and get a response that it was correct. However even with a valid response back from google, the form is not being submitted to the database.

    So, what did I do wrong? or Where can I fix it?

  • By Chris, July 15, 2013 @ 11:13 pm

    Nevermind, it appears that this is a database call issue, not a Captcha issue. If you leave the table definitions blank in the config file, it doesn't seem to use the default names. If you add the table names into the config setting it works.

  • By Matheus (X-warrior) Bratfisch, July 16, 2013 @ 12:06 pm

    I'm glad that you solved.

    Thanks for your feedback

  • By RouteOne, August 30, 2013 @ 6:38 pm

    Hi Matheus,

    please excuse my first more than lousy English. I use the Google translator for this :-)

    I just registered for this forum, but I can not login. It always comes back the message, even though I enter it right.

    "An Error Has Occurred! The letters you typed do not match the letters that were shown in the picture."

    So I describe my problem here.

    I use Yourls 1.6 and have your multi-user YOURLs Plugin - Version 1.6 (beta) installed. It works perfectly except for 2 things. I can not delete or modify the short URL.

    When I click on edit only appears a white page. When I click delete, only the delete button disappears but nothing else happens.

    Where can be the cause for this problem?

    I hope you can help me, because I would like to use your plugin.

    Thank you very much
    RouteOn

  • By Matheus (X-warrior) Bratfisch, February 3, 2014 @ 10:56 am

    Is this a spam ?

  • By Ryan, March 7, 2014 @ 8:44 pm

    how exactly do i add users for login

  • By John, March 8, 2014 @ 5:02 am

    I have installed the plugin in YOURLS 1.7. Everything seems fine but the Action buttons are not working correctly. When I click on them, they disappear but when I am logeedin with Admin, then all action button works perfectly. Please guide me with the situation. You can reply me by mail as well. Waiting for your reply. Thanks.

  • By NetNut404, April 11, 2014 @ 4:25 pm

    I noticed that when enabling this plugin and I have debugging turned on I get these two messages..

    Notice: Constant YOURLS_MULTIUSER_CAPTCHA already defined in /usr/share/yourls/user/plugins/multi-user/mufunctions.php on line 19

    Notice: Constant YOURLS_MULTIUSER_CAPTCHA already defined in /usr/share/yourls/user/plugins/multi-user/mufunctions.php on line 22

    is there something I should edit, and does this happen just for me?

  • By NetNut404, April 11, 2014 @ 6:07 pm

    I register a user at the multi-user site by email address and then I get this message... Fatal error: Call to undefined function yourls_plural() in /usr/share/yourls/user/plugins/multi-user/admin.php

    any pointers?

  • By Matheus (X-warrior) Bratfisch, April 13, 2014 @ 6:25 pm

    Hey John, right now the plugin is not supporting the YOURLS 1.7 sorry. I will let you know if I have any update on this.

  • By Charles, May 24, 2014 @ 12:54 pm

    I tried to install this for 1.7 and I just see the token after logging in. Is that the only result from the current beta?

  • By Mark Emery, June 7, 2014 @ 5:19 pm

    NetNut404, the reason 1.7 is failing is because in YOURLS 1.7 the yourls_plural() function is depreciated. It's a super simple function thankfully that just adds a "s" if > 1. Stick it back in your functions.php and comment it out in functions-deprecated.php and you'll be back in business!

    // Return word or words if more than one
    function yourls_plural( $word, $count=1 ) {
    return $word . ($count > 1 ? 's' : '');
    }

    Or update the Multi-User code to use yourls_n() instead. See the function in https://code.google.com/p/yourls/source/browse/trunk/includes/functions-l10n.php?r=891 e.g. yourls_n("day","days",$num)

  • By Francesco, July 9, 2014 @ 7:44 am

    Great plugin! Almost does what I need ;) Is there a way to make the plugin use a Drupal website's users? Thanks!

  • By Matheus (X-warrior) Bratfisch, July 23, 2014 @ 8:59 am

    @Charles,

    I'm not working on multi-user plugin to YOURLS 1.7 yet. I want to, but I need to buy some time.

    @Mark Emery,

    Good point. Thanks for helping then. I'm definitely out of time.

    @Francesco,

    It should be possible, but I don't have plans to add this to it.

  • By family guy jewish holidays, July 24, 2014 @ 10:25 pm

    Excellent post. I was checking constantly this blog and I'm impressed!
    Extremely useful information specially the ultimate
    phase :) I handle such information much. I was looking for this particular information for a long time.
    Thanks and good luck.

  • By new running shoes 2014, July 27, 2014 @ 2:27 pm

    Just wish to say your article is as surprising. The clearness in your post is simply nice and i can assume you are an expert on this subject.
    Fine with your permission let me to grab your feed to
    keep updated with forthcoming post. Thanks
    a million and please keep up the enjoyable work.

  • By Cheap PPC Advertising, July 27, 2014 @ 4:05 pm

    Have you ever considered writing an e-book or guest authoring on other
    blogs? I have a blog based on the same subjects you discuss and would really like to have you share some stories/information. I know my subscribers would appreciate your work.
    If you're even remotely interested, feel
    free to shoot me an email.

  • By cubase 7 crack, July 28, 2014 @ 7:03 am

    Asking questions are truly nice thing if you are not understanding something entirely, however this paragraph presents good understanding even.

  • By contract wars hack tool free download, July 28, 2014 @ 8:56 pm

    If you have chosen the right kind of weapon for online marketing strategy and have found that PPC is the right
    one for you, the next wise decision which
    you should taking is about the choice of the right kind of PPC
    firm. There are two primary reasons why so many foreign nationals historically
    have avoided buying real estate in Arab countries, including
    in Dubai. Perhaps not, but can you afford to not ever read on when My business is about to inform you of Contract Wars Hack.

  • By La Planète des singes l'affrontement film entier, July 29, 2014 @ 3:16 am

    If you have a home theatre system or a pair of loudspeakers then you will want to
    get the best possible sound quality and maximum potential from your speaker
    system. (The gears in the camera that pulled the film
    through was technology borrowed from clockwork. In some cases, surround sound is not possible in low
    frequency; however, it is not the case with Panasonic SC-PT480EB-K.

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment