MyBB Community Forums

Full Version: GoMobile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(2011-04-01, 08:06 PM)Scoutie44 Wrote: [ -> ]Hmm, that's rather curious. The cookies for whatever reason work fine on some hosts and browsers (for example everything works fine on mybbgm.com for me) yet don't work on others. Perhaps try clearing cookies then logging in again? It's an issue that's been around for a while though I personally haven't experienced it nor been able to reproduce Undecided

That didn't work for me.

I'm on Verizon with the iPhone 4.

I was already logged in from yesterday so, I cleared all cache, cookies and everything else off the computer. Went into the ACP and turned on the plugin.
Turned on the phone, was already logged in so I logged out and tried logging in again. No joy.

Keeps telling me I entered an invalid username or password. Impossible as I use Roboform and it fills out info for me.
OK did another test just now ... I asked the system to retrieve my password and input my email address.

It tells me I did not put in a valid email address. Weird.

I can log in with the regular themes.
If anyone's interested, the *potential* first gold release is available on GitHub:

https://github.com/Scoutie44/MyBB-GoMobile

I've only really changed the plugin tonight (theme is purdy much the same, though I'll have to update it for 1.6.3 of course), basically completely stripped the admin section out in favor of storing strings in a setting before moving into cache (this proved to be a challenge, as newlines weren't playing nice; my solution can be found in the update_cache function near the bottom, I dunno how "proper" it is, my thought was though that it should take care of the issue if it's host/configuration-related), and rewrote the cookies in an attempt to see if it'd solve the ongoing cookie problem, albeit not very much. As a result, the plugin size is a lot smaller, performance-wise it's relatively the same.

Anyways, if anyone would be so kind as to look over my changes and let me know if I dun goofed somewhere, it would be much appreciated Blush
(2011-05-14, 12:24 AM)Scoutie44 Wrote: [ -> ]newlines weren't playing nice

One reason why that can happen is your use of multiline strings in PHP

// Default strings
$strings = "iPhone
iPod
mobile
Android
...

Depending on how / where the file is uploaded you may end up with \n, \r or \r\n as newline in this string. Furthermore if you're not careful when editing the file there might be problems due to trailing spaces etc in the string.

So it's better to write like this:

$strings = implode("\n", array("iphone","ipod",...))

Then you have \n newlines (and not \r or \r\n) because the code says so.

What you end up with when actually editing / saving the setting in the admin cp is another story though. I'm not sure what MyBB uses by default there (if anything).

The cache itself seems to be pointless - if it's a setting, it's already in memory anyway so there is no need for the extra cache. explode()ing it into a list is not expensive.
(2011-05-14, 03:48 PM)frostschutz Wrote: [ -> ]What you end up with when actually editing / saving the setting in the admin cp is another story though. I'm not sure what MyBB uses by default there (if anything).

Yeah, that's the other problem. I don't know if MyBB's implementation could vary from host/host, etc. so it's a little bit difficult to try and standardize it

Quote:The cache itself seems to be pointless - if it's a setting, it's already in memory anyway so there is no need for the extra cache. explode()ing it into a list is not expensive.

Hmm, forgot about that Toungue

Maybe I'll just use your code for imploding on the first installation and add the option per-install to change the separator if need be? My current method isn't very clean or handled very well at all so that might be a better option.

So, on that note, would that be a better solution? Implode the list as you mentioned then create a setting so admins can choose from "\n", "\r" or "\r\n" (or whatever order it is) if it doesn't work?
You could always do something like this to make them all \n:

$strings = str_replace("\r\n", "\n", $strings);
$strings = str_replace("\r", "\n", $strings);

That would get rid of the \r\n then get rid of \r, leaving a \n.
Hmm, okay, I think I'll give that a shot then! Thanks Big Grin
(2011-05-15, 02:29 PM)Jammerx2 Wrote: [ -> ]
$strings = str_replace("\r\n", "\n", $strings);
$strings = str_replace("\r", "\n", $strings);

$strings = str_replace(array("\r\n", "\r"), "\n", $strings);

?
Yeah, that would be better, I just woke up when I posted that (actually got to sleep in Big Grin).
Haha, try eating and coding, that's a nightmare. :|
(2011-05-14, 12:24 AM)Scoutie44 Wrote: [ -> ]If anyone's interested, the *potential* first gold release is available on GitHub:

https://github.com/Scoutie44/MyBB-GoMobile

I've only really changed the plugin tonight (theme is purdy much the same, though I'll have to update it for 1.6.3 of course), basically completely stripped the admin section out in favor of storing strings in a setting before moving into cache (this proved to be a challenge, as newlines weren't playing nice; my solution can be found in the update_cache function near the bottom, I dunno how "proper" it is, my thought was though that it should take care of the issue if it's host/configuration-related), and rewrote the cookies in an attempt to see if it'd solve the ongoing cookie problem, albeit not very much. As a result, the plugin size is a lot smaller, performance-wise it's relatively the same.

Anyways, if anyone would be so kind as to look over my changes and let me know if I dun goofed somewhere, it would be much appreciated Blush


Awesome! Thanks Smile
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15