admin (no pm's please) Site Admin


 Virtual Cash: 22860
Joined: 22 May 2005 Posts: 25384
Add Karma
 rated by 213 members
Add Comment
Show Comments
 |
Posted: Sun Jun 28, 2009 6:45 am Post subject: Small change userinfo/adverts |
|
|
This will effect things like the userinfo portal as well as being notable enough that there might be ramifications else where.
By and large to keep load down we only do things where they are needed, so geographic profiling (e.g. finding out which Country users are in) could occur in two places, once if you use the userinfo portal to set flags, and once if you have adverts on your forum, in which case it could also occur there to allow some adverts to be targeted by Country.
This is messy and problematic
So code will come in this week that will simply do the country code bit at the start.
This means that if you use the USERINFO portal not to show it, but simply to record user flags, you will still need to include it, but it should be less sensitive the placement, as all work with cookies will have been done already.
It will also tighten up advertising a little, which helps us to keep the number of adverts down. Last but not least it may avoid the country profiling happening twice sometimes and speed things up just a little.
_________________
Family Friendly Shareware | | Web Design/Services | Free Forums
|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 22860
Joined: 22 May 2005 Posts: 25384
Add Karma
 rated by 213 members
Add Comment
Show Comments
 |
Posted: Tue Jun 30, 2009 10:02 am Post subject: |
|
|
Aside from some issues that will show up no doubt in testing, the new code is there. It creates unified code between phpbb3/2 which has to help
I have to throw in a phpbb3 rant, though there is similar code in phpbb2.
The proper place to figure out what adverts to show is just after the "session" is created, we don't tailor adverts to particular users, but we do want to know if the user is registered or a guest.
But the phpbb3 session_begin function has multiple exit points, so such code cannot be placed there.
Anyone with any programming experience (and any book on programming standards) will tell you that functions should have a single exit point.
More advanced programmers will tell you that wholesale adherence to such standards is slavish, there are reasonable exceptions to such rules.
However session_begin is not one of them, it performs a long complex operation and it stands to reason that there may be a purpose to adding functionality to it. The phpbb3 coders themselves will probably find they need to, let alone third parties.
When it happens the session code will as it stands need to be restructured leading to sessions bugs
For my part, I have sensibly chosen not to touch the session code, but to call the advert defining code elsewhere, making sure it will only do the work once if it ends up called multiple times. Not elegant but at least safe. _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
|
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 14250
Joined: 10 May 2008 Posts: 1366
Add Karma
 rated by 18 members
Add Comment
Show Comments
 |
Posted: Tue Jun 30, 2009 1:41 pm Post subject: |
|
|
I have a member (using Chrome) that has problems with I believe sessions. He says he can only login once daily. Could that be what is causing it? _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 22860
Joined: 22 May 2005 Posts: 25384
Add Karma
 rated by 213 members
Add Comment
Show Comments
 |
Posted: Tue Jun 30, 2009 1:47 pm Post subject: |
|
|
We have not changed the phpbb3 sessions code at all really. It is too complicated to want to change and as I say too badly structured to make changing it safe.
I bet there are bugs still left in the session code though But they are for phpbb3 to resolve and not us. _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
|
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 14250
Joined: 10 May 2008 Posts: 1366
Add Karma
 rated by 18 members
Add Comment
Show Comments
 |
Posted: Tue Jun 30, 2009 6:27 pm Post subject: |
|
|
Well, he's the first real chrome user on my board I think. I'm not sure what the problem is, especially since chrome still isn't a major browser. _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 22860
Joined: 22 May 2005 Posts: 25384
Add Karma
 rated by 213 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 14250
Joined: 10 May 2008 Posts: 1366
Add Karma
 rated by 18 members
Add Comment
Show Comments
 |
Posted: Sat Jul 11, 2009 9:41 pm Post subject: |
|
|
I just noticed this, though I added in a bit of javascript to counter it incase it ever does pop up...
The country codes are again stored in uppercase. Currently I use this code:
| Code: | <!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Country" -->
<img id="{postrow.POST_AUTHOR}_cn" src="/ranks/ccflags25x15/{postrow.custom_fields.PROFILE_FIELD_VALUE}.png" />
<script language="Javascript" type="text/javascript">
var counid = "{postrow.custom_fields.PROFILE_FIELD_VALUE}";
var counend = counid.toLowerCase();
var counsrc = "/ranks/ccflags25x15/" + counend + ".png";
document.getElementById("{postrow.POST_AUTHOR}_cn").src=counsrc;
</script>
<!-- ENDIF --> |
It works nicely enough. _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 22860
Joined: 22 May 2005 Posts: 25384
Add Karma
 rated by 213 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zina2008 Apprentice


 Virtual Cash: 1120
Joined: 17 Dec 2008 Posts: 105
Location: Scotland Add Karma
 rated by 3 members
Add Comment
Show Comments
 |
Posted: Sun Jul 19, 2009 5:01 pm Post subject: |
|
|
This is an odd little problem, which only turns up occasionally, but it does look as though it's connected to the advert / country ID thing. So I apologise if I've put it in the wrong place.
I have two MYFF forums, both with almost identical set-ups, and the same thing happens to both. The images come from ht tp://firefly2.myfreeforum.org/index.php.
Occasionally, when I try to change the page (e.g. by replying) or sometimes on first entering the page, I get this error message:
| Quote: | | Fatal error: Cannot redeclare findcountry() in /home/httpd/vhosts/slarti.myfreeforum.org/httpdocs/phpBB3/altad.php on line 32 |
Instead of seeing my dual portals and the main part in the middle, I get the left hand portal and the top, down to where the advert should be, and then it stops with the error message - no forums and no right-hand portal.
The problem has always, as far as I know, been cleared with a Refresh/Reload.
It's very unpredictable, and hasn't happened (to me) more than once a day on each board, but I don't know if it has happened to anyone else - nobody has mentioned it, but because it's so easily cleared they may not have thought it worth a mention.
I can't replicate it, but these screenshots should show you how it looks:
With the error message - and nothing after it.
The way it normally looks.
This has only been happening for a week or possibly up to two, something like that, and I haven't made any major changes in that time.
|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 22860
Joined: 22 May 2005 Posts: 25384
Add Karma
 rated by 213 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zina2008 Apprentice


 Virtual Cash: 1120
Joined: 17 Dec 2008 Posts: 105
Location: Scotland Add Karma
 rated by 3 members
Add Comment
Show Comments
 |
Posted: Sun Jul 19, 2009 5:14 pm Post subject: |
|
|
Four minutes?
You're a star, Admin! I hope you're on overtime.
|
|
| Back to top |
|
 |