Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2012
    Posts
    282
    Plugin Contributions
    0

    Default coding questions, programmer questions, where should they be asked?

    I've completed several mods and add-ons for my client and would like to be able to offer up as plugins eventually. If I have ZC code specific questions, programmer questions or troubleshooting questions etc. (all ZenCart related), is there a place on here I could ask them?

    for example, right now i'd like to know where the global var $db gets instantiated?

    or where does EOF come from? (not finding that on php.net)

    stuff like that, i'd very much like know. or perhaps, if for some reason it's not appropriate to ask such questions at all let me know, thanks

  2. #2
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: coding questions, programmer questions, where should they be asked?

    A quick use of the developers Toolkit finds $db instantiated here:
    admin/includes/init_includes/init_database.php
    and
    includes/init_includes/init_database.php

    I believe EOF is part of the language and is a logical value (usually defined as a negative int) Correct me if I am wrong?
    Last edited by gilby; 12 Sep 2013 at 05:10 AM.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: coding questions, programmer questions, where should they be asked?

    $db is instantiated by the core code. You should never touch it. Simply declare it as a global var from within whatever function you've written which requires it.

    EOF is a fairly well-known acronym amongst programmers, although moreso for veterans who were exposed to mainframes in decades past.

    In ZC, EOF, when mentioned in a comment at the end of a file, is simply there to tell you that this is indeed the intended End Of File (EOF). It was placed there in a couple files when some much older code was removed from those files so that people wouldn't start posting that stuff is missing or ask if they should put the old junk back in.
    You'll see "bof" (beginning of file, or beginning of section) and "eof" (end of file or end of section) in some template comments also ... and if the meaning isn't obvious, it's to denote the beginning and ending of lines of code which belong together, such as when someone comes along and wants to move things around.
    They're all simply cues to help explain intentions.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: coding questions, programmer questions, where should they be asked?

    I suspect it was more the EOF in the php code such as
    Code:
    while (!$category_products->EOF) {
    that the OP was asking about?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: coding questions, programmer questions, where should they be asked?

    Oh. Ya, that makes sense too.

    Same meaning there also: EOF used as meaning of end-of-dataset, as in end-of-results-list-from-the-query-that-was-run. It's a boolean true/false which is set to true when the movenext() pushes the pointer to the end of the set of returned query data.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v154 Page frequently asked questions, links to fold open, how to
    By Pompidompie in forum General Questions
    Replies: 0
    Last Post: 9 Apr 2015, 08:18 AM
  2. Replies: 3
    Last Post: 22 Jun 2012, 05:36 AM
  3. Need to change frequently asked questions
    By DivaNU in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Dec 2010, 03:29 AM
  4. Have I asked to many questions??
    By hells1614 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Apr 2008, 02:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR