Jump to content

garek007

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

garek007's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. sweet thanks. Maybe I'll try it. I did a test with a coworker where we both hit submit at the same time and it still wrote. Now I'm sure it's more complicated that that, like we probably were milliseconds apart, but I also added a safety so that it also emails me the form data. This way, I have a backup in case it doesn't write. Maybe by the end of the week I can get the mechanism in place to write to the DB. It doesn't look too hard and I think I saw some code earlier when I asked THE GOOGLE.
  2. hey thanks for that. what do you mean doesn't work on windows? just the LOCK_NB flag doesn't work on windows? Or the whole thing? If I do it with mysql instead, do I still have to lock the database while it's writing? or is it a lot more straightforward? By that I mean, will SQL police itself for simultaneous attempts to write?
  3. I was just going to open the file and add to the end of it... not overwrite it each time. That won't work? I hadn't thought about simultaneous submissions though... Our audience will be small, but I suppose it could happen...
  4. Hi, I need to create a landing page with a form. That form needs to be recorded somewhere instead of sent to email. I know I can write it to a SQL database, and then to an excel file. But I only need a temporary solution so I figured I'd just go straight to CSV. Is this bad practice? What potential problems might I encounter other than security issues?
  5. No worries, I figured out a different way to accomplish what I needed. I imagine I'll read about this and eventually learn what I need to know. Thanks for your help though!
  6. Mahngiel. Sorry I should have specified. ignore the first Itemid (capital I). That is accessing the Joomla database. The second itemid (lowercase I) is used to go through the object. That foreach loop actually works fine, it was default and I am still trying to modify it. It works fine, but I just want to understand what is happening.
  7. Hi, I'm using the Joomla CMS and I encountered some PHP code I'm really struggling with. I'm hoping someone can help me. The code appears to loop through an array, but I discovered that it's not just a simple array. I discovered this when trying to iterate through it myself with a foreach loop. The loop failed, and I found that the item being iterated was an object??? So that means it's a little more complex. So i did a varDump and found out that it is indeed very, very complex. I just want to understand the foreach loop and what it's doing. I understand it as it pertains to a simple array, but this is not a simple array. Here is the code. (the switch statement was added by me) foreach ($list as $i => &$item) : $class = 'item-'.$item->id; switch($item->id){ case 103: if ((in_array($Itemid, array(109, 110, 111,112)))){$class .= ' active';} break; case 104: if ((in_array($Itemid, array(113, 115, 114)))){$class .= ' active';} break; case 105: if ((in_array($Itemid, array(116,117,118)))){$class .= ' active';} break; default: break; } if ($item->id == $active_id) { $class .= ' current'; } if (in_array($item->id, $path)) { $class .= ' active'; } elseif ($item->type == 'alias') { $aliasToId = $item->params->get('aliasoptions'); if (count($path) > 0 && $aliasToId == $path[count($path)-1]) { $class .= ' active'; } elseif (in_array($aliasToId, $path)) { $class .= ' alias-parent-active'; } } if ($item->deeper) { $class .= ' deeper'; } if ($item->parent) { $class .= ' parent'; } if (!empty($class)) { $class = ' class="'.trim($class) .'"'; } //===================================================================== echo '<li'.$class.'>'; // Render the menu item. switch ($item->type) : case 'separator': case 'url': case 'component': require JModuleHelper::getLayoutPath('mod_menu', 'default_'.$item->type); break; default: require JModuleHelper::getLayoutPath('mod_menu', 'default_url'); break; endswitch; // The next item is deeper. if ($item->deeper) { echo '<ul>'; } // The next item is shallower. elseif ($item->shallower) { echo '</li>'; echo str_repeat('</ul></li>', $item->level_diff); } // The next item is on the same level. else { echo '</li>'; } endforeach
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.