*

Recent

Author Topic: Re foreach errors.  (Read 7092 times)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re foreach errors.
« on: March 17, 2011, 09:02:11 PM »
I finally got around to having a look at this, and while this is not a verbatim process - and the fact that I've re-written all the templates means it's not going to be a simple cut and paste.

You need to drop all of those if(! etc echo ' etc and try the samples below - You'll also need to add the } where appropriate to close of the else statement.

Anyway, I think you'll understand what's happening. :P

Pity there's no "Hide" wrappers here? :(

Code: [Select]
pages.php

if (empty($r1)){
echo '
<tr>
<td>
<div class="msg">There currently are no pages.<br /><a href="javascript:void(0)" onclick="history.go(-1)">Go Back</a></div>
';

}else{

echo '
<tr>
<td valign=\'top\' colspan=\'2\' class=\'content-title-big\'>';

foreach($r1 as $in ){


ETC.

========================================

base_home.php X "Twice"

if (empty($baseir1)){
echo '
<tr>
<td>
<div class="msg">There currently are no games in this category.<br /><a href="javascript:void(0)" onclick="history.go(-1)">Go Back</a></div>
';

}else{

foreach($baseir1 as $row ){

ETC.

==============================================

browse.php

$count = 0;

if (empty($r1)){
echo '
<tr>
<td>
<div class="msg">There currently are no games in this category.<br /><a href="javascript:void(0)" onclick="history.go(-1)">Go Back</a></div>

</td>
</tr>
</table>
';

}else{

foreach($r1 as $in ){


ETC.

===============================================

blog.php

if (empty($r1)){
echo '

<tr>
<td colspan=\'2\' class=\'msg\'>There currently are no blog entries.<br /><a href="javascript:void(0)" onclick="history.go(-1)">Go Back</a></td>
</tr>

';
}else{

foreach($r1 as &$in){

« Last Edit: March 17, 2011, 09:04:49 PM by mort »

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Re foreach errors.
« Reply #1 on: March 18, 2011, 12:15:27 AM »
Yes, I see what you're saying. This is about what was planned for when we get 2.2 out. 2.1 is going to absorb all the time we have right now, and will cause this to have to be slightly redone to fit. Right now, we figured that if a category is empty, it would be turned off, or inactive. Same for the blog and pages.  That is part of why those settings were put into place after all. But this is about what we are expecting to put into place when it is revisited while coding for 2.2 is on the table.

Part of the problem is also we are attempting to keep it understandable by peeps like me, who can do some code work, but are definitely NOT professional grade lol. Better templating could be done, but it might leave a few people unable to edit and change their own code. The script is meant for those who want a low cost alternative to the so called premium scripts, but offers at least most of the features. I think we struck a good balance, thought admitedly, I'm slightly biased ;)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Re foreach errors.
« Reply #2 on: March 19, 2011, 05:43:11 AM »
Right now, we figured that if a category is empty, it would be turned off, or inactive.

I disagree with that because instead of an error message it could be used to call and include a CMS file such as "/cms/boom-boom.php", and that file could either be empty or populated with something like "WATCH THIS SPACE" and/or a whole lot of blah to go with it. (Just to keep the natives excited) ;)

2.1 is going to absorb all the time we have right now,

Firstly, (foreach) doesn't work as a single query. It either needs an argument or an array. The code I submitted gives it an argument. ;)

Secondly:

Can I have a copy of v2.1 where you are up to with it now?

If yes, PM me a link to download it - and I'll have a browse. ')
« Last Edit: March 19, 2011, 06:16:26 AM by mort »

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Re foreach errors.
« Reply #3 on: March 19, 2011, 03:17:03 PM »
"WATCH THIS SPACE" Hmmm now there's an idea I had not thought of. I like it lol.

2.1 is nearing finished, we think, we currently have the language files off to somebody to translate them into a different language than English. When we get them back, we drop them into place, and tell it to use that language. If there is still English shown, we fix it so that its also included in the languge files, and ask to have that new part translated. When no English is shown, it should be ready to package up and try the next release candidate. Till then, I don't think we even have an install file, let alone the files zipped up yet. Sorry, but this release is one where every one of us is being hammered in the real world by things that take priority unfortunately. This is part of the reason some of the things are not going to get done this release. Give me some time to see if we do have enough of it ready to zip up yet? I'll have to find out where it stands lol.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Re foreach errors.
« Reply #4 on: March 20, 2011, 07:56:53 AM »
Till then, I don't think we even have an install file, let alone the files zipped up yet.

I don't need an install file - I can install it without the "Idiot Guide" :P

Have you people ever thought about SVN - It keeps track of all changes and updates to files, by whoever edits the files etc.

It can make life a whole lot easier - "Tortoise" is a nice one. ;)