All forum admins should look: SMF 2.0 iPhone and iPod Touch Theme (NOW FREE!)

Started by farfromperfection, March 10, 2009, 11:09:28 AM

Previous topic - Next topic

farfromperfection

Quote from: altivec on March 21, 2009, 05:58:06 AM
My theme ID is really 8.

Still can't get it to work.... tried on my account (admin) and on guest.
That should definitely work. Are you testing on an iPhone/iPod ?

altivec


Antechinus

Just out of interest what is the default screen resolution for an iPhone?

farfromperfection


farfromperfection

Okay so theres an issue with the time/date on some servers.

SMF must store the timestamp of posts as different than the servers default time or something.

Because to get the "number of seconds ago" that a topic was posted, this theme does time()-$topic['first_post']['timestamp'] or whatever, and its showing like -2000 seconds and stuff on some sites. so how do I get the CURRENT timestamp according to SMF as opposed to time() which gives the time the server says?

farfromperfection

I also need to fix how quotes appear in posts.

So thats:

- image resizing
- long links
- quotes
- topic start times

any other issues?

Dragooon

Quote from: farfromperfection on March 22, 2009, 12:27:50 AM
Okay so theres an issue with the time/date on some servers.

SMF must store the timestamp of posts as different than the servers default time or something.

Because to get the "number of seconds ago" that a topic was posted, this theme does time()-$topic['first_post']['timestamp'] or whatever, and its showing like -2000 seconds and stuff on some sites. so how do I get the CURRENT timestamp according to SMF as opposed to time() which gives the time the server says?
Try forum_time();

Quote from: farfromperfection on March 21, 2009, 06:12:36 PM
Quote from: altivec on March 21, 2009, 05:58:06 AM
My theme ID is really 8.

Still can't get it to work.... tried on my account (admin) and on guest.
That should definitely work. Are you testing on an iPhone/iPod ?
Your code won't work. The theme does not load based upon that variable. Use the code I posted here.

farfromperfection

Quote from: Dragooon on March 22, 2009, 12:38:28 AM
Try forum_time();
Thanks!

Quote from: Dragooon on March 22, 2009, 12:38:28 AM
Your code won't work. The theme does not load based upon that variable. Use the code I posted here.
Are you sure? Because that code works fine on my forum, on line 483 of Load.php ???

Dragooon

Maybe because you're already switched to that theme on your iPod(Using URL)?

farfromperfection

Quote from: Dragooon on March 22, 2009, 12:57:50 AM
Maybe because you're already switched to that theme on your iPod(Using URL)?
Nope. I'm switching user agents between Safari 4 (desktop browser) and the iPhone's browser and its switching theme as I do this.

altivec

Still doesn't work :S

Quote from: Dragooon on March 21, 2009, 06:02:01 AM
Load.php
Find this
// The theme was specified by parameter.
if (!empty($ID_THEME))
$ID_THEME = (int) $ID_THEME;
// Use the board's specific theme.

Replace with
// The theme was specified by parameter.
if (!empty($ID_THEME))
$ID_THEME = (int) $ID_THEME;
elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod'))
$ID_THEME = 8;
// Use the board's specific theme.


Dragooon


LS1Tiger

hey guys, tryin to use this and im gettin a server 500 error...any ideas?
LS1Tiger
-- hxxp:www.krewedawakening.com [nonactive]
-- hxxp:www.krewedawakening.com/forum/?imode [nonactive] <-- not finished

farfromperfection

Quote from: LS1Tiger on March 22, 2009, 05:48:32 PM
hey guys, tryin to use this and im gettin a server 500 error...any ideas?
Thats odd.
Can you check your server error logs?

When are you getting the error exactly?
Is it when you edit load.php or just when you try to use the theme?

LS1Tiger

Can't get my server logs. On my iPhone right now

I edited Load to make it send to the correct forum. Mine is 15. I put 1 in and it works. 15 gets me the 500 error.
LS1Tiger
-- hxxp:www.krewedawakening.com [nonactive]
-- hxxp:www.krewedawakening.com/forum/?imode [nonactive] <-- not finished

altivec

Yup am sure it's them 8, have a look at the other post i made and gave links.

Leemy

Quote from: altivec on March 21, 2009, 06:59:27 PM
Yup on my iPhone

Give it a try:
http://www.clubmr2quebec.com/forums/

Link for iPhone theme:
http://www.clubmr2quebec.com/forums/?theme=8

Running SMF 2 rc1

Tried this and it loaded the normal page. I had to manually go to theme=8 url to make it iphone. Is that normal????? I thought it should be autoload
I have an iPhone 3G.

farfromperfection

Quote from: Saleem on March 23, 2009, 07:35:29 PM
Quote from: altivec on March 21, 2009, 06:59:27 PM
Yup on my iPhone

Give it a try:
http://www.clubmr2quebec.com/forums/

Link for iPhone theme:
http://www.clubmr2quebec.com/forums/?theme=8

Running SMF 2 rc1

Tried this and it loaded the normal page. I had to manually go to theme=8 url to make it iphone. Is that normal????? I thought it should be autoload
I have an iPhone 3G.
I don't think he has it set up to do that.

altivec


farfromperfection

Are you sure you have the correct theme ID? I've tried this on two new installations and it works just fine!

Advertisement: