Announcement

Collapse
No announcement yet.

Bypassing cgi-bin links solution 2 - community collaboration.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • gabrielcrowe
    replied
    this works in all versions of actinic to date. its running on loads of catalogs i'v built.

    instead of putting it in an external file, try including it in a template, and including it in the header of your pages.

    wrap each function in:

    PHP Code:
    if (!function_exists('myfunc')) {

    function 
    myfunc(){
    // your function here
    }


    to avoid errors.

    Leave a comment:


  • AndyBorrett
    replied
    Not sure if I should have started a new thread in the v9 section, but here goes...

    Has anyone managed to get this working with v9.03?

    When I try it I get the following error after uploading.

    You don't have permission to access /acatalog/Fatal error: Call to undefined function Ref2file() in main on line 1 on this server.
    I presume it's something to do with actinic_main.php being different

    Leave a comment:


  • gabrielcrowe
    replied
    i still am, on every site i make.

    i have found it stable, and fast.

    in particular, i have just added another addition to the php menu builder, that also uses flat filenames, instead of cgi-bin numbers.

    much better for seo.

    Leave a comment:


  • Darren B
    replied
    Has anyone or is anyone still using this, something that was on my to do list and is still on my to do list.

    If so is there anything i need to watch out for, mind you my actinic_main.php is ermm a little different to the original lol, get all fat and juicy

    D

    Leave a comment:


  • fergusw
    replied
    Good point Norman. I have edited original post to add an additional function for returning number of products 'excluding' the deleted duplicates.

    Regarding occasional crashes..... I've not noticed any yet! I see memory error warning and crash upon opening if I have any incorrect syntax in the actinic_main.php file, but not upon exit.... yet!

    Leave a comment:


  • NormanRouxel
    replied
    Fergus,

    You may need some extra conditions to make sure that the Duplicate isn't deleted.

    Also, are you seeing the occassional crash when exiting Actinic that Gabriel and I saw when doing this sort of ODBC stuff.

    Leave a comment:


  • gabrielcrowe
    replied
    well, isnt that just crap-tacular.

    Leave a comment:


  • fergusw
    replied
    PHP Code:
    odbc_num_rows 
    would be the one you mean, however for MS Access it returns -1

    Leave a comment:


  • gabrielcrowe
    replied
    is there an odbc function that counts rows? do you really have to page through the results?

    Leave a comment:


  • gabrielcrowe
    replied
    Needs testing
    this, is my favourite phrase. its a shame more people dont test as much as you mr fergus.

    Leave a comment:


  • fergusw
    replied
    OK - another application:

    Return a value if a product HAS duplicates:
    PHP Code:
    /************************************************************************
    * DoesProdHaveDuplicates - Returns  a yes/no value if a product 
    * has  one or more duplicates
    * @param $prodid   - ProductID from Actinic

    * Usage example:
    Has a duplicate?: <actinic:block php="true">echo DoesProdHaveDuplicates("<actinic:variable name="ProductID" />");</actinic:block>
    *************************************************************************/
    function DoesProdHaveDuplicates($prodid)
        {
        
    $prodid str_replace("{","",$prodid);
        
    $prodid str_replace("}","",$prodid);
        
    $blreturn 'no';
            
    $connect odbc_connect("ActinicCatalog8","","");
            
    $query "SELECT [nParentSectionID] FROM [product] WHERE [sOriginalProdRef] = '".$prodid."'";
            
    $result odbc_exec($connect$query);
            
            
    $count=0;
            while(
    $temp odbc_fetch_into($result,&$counter)){
                
    $count++;
            }
            if (
    $count 0) {
                
    $blreturn 'yes';
                }

            
    odbc_close($connect);
            
            return 
    $blreturn;
            } 
    and implementing on page with:
    Code:
    Has a duplicate: <actinic:block php="true">echo DoesProdHaveDuplicates("<actinic:variable name="ProductID" />");</actinic:block>
    This could be brought into a condition as Norman has indicated above.

    Needs testing

    [edit - to add another coding to check for deleted product duplicates. Also returns number of duplicates]

    PHP Code:
    function DoesProdHaveDuplicatesNoDeleted($prodid)
        {
        
    $prodid str_replace("{","",$prodid);
        
    $prodid str_replace("}","",$prodid);
            
    $connect odbc_connect("ActinicCatalog8","","");
            
    $query "SELECT [nParentSectionID] FROM [product] WHERE Status = 'N' AND [sOriginalProdRef] = '".$prodid."'";
            
    $result odbc_exec($connect$query);
            
            
    $count=0;
            while(
    $temp odbc_fetch_into($result,&$counter)){
                
    $count++;
            }

            
    odbc_close($connect);
            
            return 
    $count;
            } 
    usage:
    Code:
    Duplicates: <actinic:block php="true">echo DoesProdHaveDuplicatesNoDeleted("<actinic:variable name="ProductID" />");</actinic:block>

    Leave a comment:


  • fergusw
    replied
    At least this post is here with confirmation of possible solutions to people's problems, and if Norm argees, then people can be directed to Drillpine for the donationware code solutions!

    I'll see what other uses and functionality I can think up in the meantime

    Leave a comment:


  • gabrielcrowe
    replied
    done that.

    it can generate happy links from any section. and it has concept of what section you are in. it lets you generate child sections in the tree as deep as you request. it makes any structure, ul/li, dt/dl/dd, div/a. its really very easy to make a single thingybob that makes tabs, lists, flyouts etc etc.

    its not really postable.

    i'd like norman to explore this. i dont want to offend him by releasing code that trumps his collapso. to this end, since he started the code off in my head, i'll be sending what i've done to him.

    is that ok norm?

    Leave a comment:


  • fergusw
    replied
    Ok - thinking aloud here......

    Could this method not also be used for generating navigation structures.
    I'm thinking of a way to generate section/sub-section flyout or expanded menu dynamically allowing for different section structures on each page without oodles of blockifs.

    All you require is a the PHP query to the database to return relevant sections/section HTML filenames into a nice <ul><li> structure and voila.....

    e.g. each sub-section you go into could simply have the menu showing the expanded/exploded section that you are currently in.
    This would eliminate any javascript overhead, and allow for reduced HTML overhead, especially on large sites.

    *stops thinking out loud*

    Leave a comment:


  • gabrielcrowe
    replied
    sexy stuff.

    mission complete!

    Leave a comment:

Working...
X