MyBB Community Forums

Full Version: Hire someone to help with either A) fixing this plugin so it works or B) making a new
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Plugin which blocks links to guests and unverified, except in specific forums and parent forums. 

This worked great in 1.6. Upgraded to 1.8 and now the conditional isn't working. The links in forums that are supposed to be showing to all are blocked. So, if logged in, everyone can see. Okay, that's good. If logged out, none of the links can be seen in any forum.

  Have tried a few debugging, such as using conditionals separate, but they return a funky page.

I'm not sure if it's something from 1.6 to 1.8 that changed, or if something went wrong during the upgrade that's causing this not to work.

if($forum['pid'] != 70 && !in_array($forum['fid'], array(100,140,68,78,39,159,56,160)) && in_array($mybb->usergroup['gid'], array(1, 5, 7, 12)))


I've tried with two different plugins, 

The two plugins I've been working with are:


AN Only Registered: https://community.mybb.com/mods.php?action=view&pid=284 and Registered Links: https://community.mybb.com/mods.php?action=view&pid=222 . I prefer AN Only Registered because it displays a nicer formatted message if a user isn't signed in.

There's a third plugin here, that actually let's you set forums and groups in ACP, but it hasn't been updated since 1.4. Have tried changing compatibility, but returns a 500 when trying to enable: https://mods.mybb.com/view/hide-links-to-guests-for-14

Anybody that can fix this, or create a new plugin that works as we need, please let me know your rates.
It can be fixed or new plugin can be written, or a new one can be written for mybb 1.8.x with your requeriments but i think nobody will do this for free due is not usefull at all.

But anyway yes if your question is that then i have to response to you i can make plugins and fix some 1.6 to 1.8.x but it requires many time to do.

Anyway i will verify your mod because i think is easy to make it works, at least your provided code. But i have to check it out in my test board to see what can be the problem, i have written right now a quick fix for it but i do not know if really works because i have to test it before say anything Smile
Okay Whiteneo. Thank you for your time. Looking forward to your results. Smile
Ok it was easy then, you have a code that require an exclusive post id if it is on the list then do it, so i think you have to remove that and use only forums and groups or at least that is what i suppose you wanna do, so change it to:

if(!in_array($forum['fid'], array(100,140,68,78,39,159,56,160)) && in_array($mybb->usergroup['gid'], array(1, 5, 7, 12)))

You can use user too, but same results are there, and you must globalize forum var and an if conditional due some parts use fid val instead forum fid, so you can test it with that parts.


if(!in_array($fid, array(100,140,68,78,39,159,56,160)) && in_array($mybb->user['usergroup'], array(1, 5, 7, 12)))

Both codes have to work but you have to globalize fid or forum and see in what parts response and what parts do not to retrieve right fid val.

See yah !!
Hmm... This is still not working for me using your line. All links regardless of forum are blocked if not logged in.

You have tested and working fine on yours?

BTW: $forum['pid'] is parent forum ID. (reference: https://community.mybb.com/post-837316.html). Worked great with 1.6. Don't know if $forum['pid'] no longer used in 1.8.
On my server side yeah, only when i remove that line because that pid is never present so allways hide all contents (urls retrieved). Parent forums have to been added into fid lines due forums are in there and id is that.

I do not know about parent ids.

But what is the entire code you use because i think you are missing something there.

Yes in my server side works fine, but i only have one forum and some posts so i can not test better.

And that vars if exist in 1.6 probably are the same due there are there but i do not know for sure.

I do not use 1.6, since 1.7 release so i have no idea because many of my plugins have to be rewriten and other i have to do the same to make it works into mybb 1.8.x.

Or use your actual code but bring real data because as i said before some parts of that instances are changed forum var is not present at all, and so on, you have to set real values for any case.
Thank you again for your reply. This is killing me. Because out of everything I expected to go wrong about the upgrade, this was not something I thought would be difficult.

The code is from these two plugins:
AN Only Registered: https://community.mybb.com/mods.php?action=view&pid=284 and Registered Links: https://community.mybb.com/mods.php?action=view&pid=222 . I prefer AN Only Registered because it displays a nicer formatted message if a user isn't signed in.

I have now tested on a fresh install and it's still not working (links which should be public are still hidden). There is SOMETHING that changed from 1.6 to 1.8 that is ignoring this conditional or something else about the variables.

I have a feeling it's something simple, but what it is... Is beyond my knowledge.

The code I'm using on the test forum is:
if(!in_array($fid, array(3,4)) && in_array($mybb->user['usergroup'], array(1, 5)))
Yeah i know that bro but entire code i mean to know if you have declared propertly i will review your data to test and make it works anyway thanks in advance Smile

Ok i have readed a data is on my pms but none, so only i can say the code if you write that way you will not see a working on plugin due that values are not declared as i said before, you need to globalize vars to make it works and if you can provide me a test account for ftp only and a registered user account data who can see the links, and i suppose guests do not, so an url with the current data to see when is hidden or not.

Only i need that to test it. Anyway i have tested on my board but i do not understand what you want at all Smile
I want all links to be hidden to user groups 1&5, except for in specific forums. We need certain forums to have public links (news forums etc...) That's it.

The code I have not changed from 1.6. Exact same.

I tried creating an FTP account for you, but I can't get it to work right (I just spent an hour trying to get FTP account working. Set it up no problem, and set settings exactly as specified by the server, but impossible to logon.

I will send the details to your PM anyways,
Ok i will wait until then and i will see it.

I am trying right now but without results so i will wait.

But yes i will review it and see what can be done more easy Smile

Thanks for all----

Ok i can connect into ftp but only there are a file called ftpquota and nothing else.

So i can not do anything that way, but i can do it on my server side anyway, i see the code into the file provided and it is wrong anyway as i said you did not globalize vars so how did you spect it this code must work ?

Well i will write a new plugin with your requeriments it is the better option i can see and try it at my own side and when ready i let you know.

See yah ....
Pages: 1 2