My SellerDeck Account | Newsletter | Free Trial

Community and Knowledge Base

Go Back   Sellerdeck Community > SellerDeck Ecommerce Software > SellerDeck v9/v8

Search powered by Google
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 55 votes, 5.00 average. Display Modes
  #31  
Old 25-Mar-2009, 10:17 PM
AndyBorrett's Avatar
AndyBorrett AndyBorrett is offline
Registered User
Join Date: Feb 2005
Full Name: Andy Borrett
Posts: 384
Thanks: 9
Thanked 11 Times in 9 Posts
After several days of trying to understand how the code works and even buying a book on Perl I think I've found the problem.

The code appears to work fine - it's the database that doesn't hold the information the code is requesting.

Code:
$connect = odbc_connect("ActinicCatalog9","","");
        $query = "SELECT [sPageName] FROM [Catalog Section] WHERE [nSectionID]=".$sectref."";
If I open up the database in Access and look in the table Catalog Section there are no records in sPageName apart from where I have specified a page name within Actinic.
I don't know if this is normal but I let Actinic generate its own pagenames for all my products to help with SEO.

The only table I can find the actual page name is FileList and I can't see any relationship to either the product or the section in there.
Does anyone know how these are linked or how I can get Actinic to populate the sPageName records?
Reply With Quote
  #32  
Old 24-Jul-2009, 05:20 PM
Gerald Lee Gerald Lee is offline
Registered User
Join Date: Apr 2006
Full Name: Gerald Lee
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I believe the solution posted in this thread nearly solves my problem but I don't know how to modify it to do so. Can anyone help?

In any given section I want to display the section images of it's siblings.

E.g. In the example below, if I am on section "Sect AB" I would see section images of "Sect AA", "Sect AC" and "Sect AD"

Sect A
Sect AA
Sect AB
Sect AC
Sect AD
Sect B
Sect BA
Sect BB
Sect C

I have tried to find a ParentSectionID variable but this does not seem to exist.The code in this thread would seem to offer the solution. How would I modify it or is there a better way?

Thanks
Reply With Quote
  #33  
Old 24-Jul-2009, 10:11 PM
AndyBorrett's Avatar
AndyBorrett AndyBorrett is offline
Registered User
Join Date: Feb 2005
Full Name: Andy Borrett
Posts: 384
Thanks: 9
Thanked 11 Times in 9 Posts
Have read through the block tutorials by Gabe on the forum? You can probably do what you want using a ChildSectionList block
Reply With Quote
  #34  
Old 24-Apr-2010, 11:46 AM
globalee globalee is offline
Registered User
Join Date: Jun 2009
Full Name: lee
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by gabrielcrowe View Post
include this code at the end of your actinic_main.php then restart actinic.

PHP Code:
/***************************************************************
* GetSectFileName - A support function for Ref2File
***************************************************************/

function GetSectFileName($sectref)
    {
        
$connect odbc_connect("ActinicCatalog8","","");
        
$query "SELECT [sPageName] FROM [Catalog Section] WHERE [nSectionID]=".$sectref."";
        
$result odbc_exec($connect$query);
        while(
odbc_fetch_row($result)){
            
//$name = odbc_result($result, 2);
            
$url odbc_result($result1);  
        }
        
odbc_close($connect);
            return 
$url;
    }

/***************************************************************
* GetProdParent - A support function for Ref2File
***************************************************************/
function GetProdParent($prodrefs)
    {
    
$prodrefs str_replace("{","",$prodrefs);
    
$prodrefs str_replace("}","",$prodrefs);
        
$connect odbc_connect("ActinicCatalog8","","");
        
$query "SELECT [nParentSectionID] FROM [product] WHERE [Product Reference]='".$prodrefs."'";
        
$result odbc_exec($connect$query);
        while(
odbc_fetch_row($result)){
            
$parentid odbc_result($result1);
        }
        
odbc_close($connect);
            return 
$parentid;

        }

/***************************************************************
* GetSectParent- A support function for Ref2File
***************************************************************/
function GetSectParent($sectrefs)
    {
    
$prodrefs str_replace("{","",$sectrefs);
    
$prodrefs str_replace("}","",$sectrefs);
        
$connect odbc_connect("ActinicCatalog8","","");
        
$query "SELECT [nParentSectionID] FROM [Catalog section] WHERE [nSectionID]=".$sectrefs."";
        
$result odbc_exec($connect$query);
        while(
odbc_fetch_row($result)){
            
$parentid odbc_result($result1);
        }
        
odbc_close($connect);
            return 
$parentid;
        }

/***************************************************************
* Ref2file - Use Actinic's pwn database, to convert a prod ref, to a filename
* @param int $ref the product reference.
* @author Gabriel Crowe + NormanRouxel 08 September 2007
*
* usage example:
<a href="<actinic:variable name="CatalogURL" /><actinic:block php="true">echo Ref2file("<actinic:variable Name="ProductReference" />");</actinic:block>">Link Text</a>
***************************************************************/
            
function Ref2File($ref) {
return 
GetSectFileName(GetProdParent($ref));
}
function 
Ref2ParentFile($ref) {
return 
GetSectFileName(GetSectParent(GetProdParent($ref)));

HTML Code:
<a href="<actinic:variable name="CatalogURL" /><actinic:block php="true">echo Ref2file("<actinic:variable Name="ProductReference" />");</actinic:block>">Link Text</a>
then make a link like this, wherever a product reference is in context, such as a marketing item.

To get the parent of the section your item is in (for single product per page lists) then make a link like this:
HTML Code:
<a href="<actinic:variable name="CatalogURL" /><actinic:block php="true">echo Ref2ParentFile("<actinic:variable Name="ProductReference" />");</actinic:block>">Link Text</a>
This will traverse up another level.


what does the code do? basically, it uses actinics own database to find the name of the section that pertains to a product. by using the product reference. The code may cause some slowdown on larger shops, but really, all it does is convert the prodref, to the filename online.

note:
**EXPERIMENTAL** causes some errors occasionally when actinic closes. Other than that, how about some testing and input?

special thanks go to NormanRouxel for the initial code.
Can i use this to link a fragment??
i got a sliding menu on my index that goes through the cgi bin, is it possible to link this directly??



<actinic:block if="%3cactinic%3avariable%20name%3d%22FragmentImageFileName%22%20%2f%3e%20%21%3d%20%22%22" >
<li>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFragmentImageALink%22%20%2f%3e" >
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFragmentLinkToURL%22%20%2f%3e" >
<a href="<actinic:variable name="FragmentLinkedItemID" />">
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFragmentLinkToProduct%22%20%2f%3e" >
<a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="FragmentLinkedItemID" /><actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e">&amp;NOLOGIN=1</actinic:block>">
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFragmentLinkToSection%22%20%2f%3e" >
<a href="<Actinic:Variable Name="SearchCGIURL"/>?SECTIONID=<actinic:variable name="FragmentLinkedItemID" /><actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">&amp;SHOP=<Actinic:Variable Name="ShopID"/></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e">&amp;NOLOGIN=1</actinic:block>">
</actinic:block>
</actinic:block>
<img src="<actinic:variable name="FragmentImageFileName" />" height="200" width="325" alt="<actinic:variable encoding="strip" name="FragmentTitle" />">
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFragmentImageALink%22%20%2f%3e" >
</a>
</actinic:block>
<h2><actinic:variable encoding="strip" name="FragmentTitle" /></h2>
<p> <actinic:variable encoding="actinic" name="FragmentText" /></p>
</li>
</actinic:block>



thanks in advance, lee
__________________
http://www.novadetox.co.uk
Reply With Quote
  #35  
Old 24-Apr-2010, 04:23 PM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,752
Thanks: 9
Thanked 734 Times in 617 Posts
If you mean link to a Brochure page, then all you need is:
Code:
<a href="<actinic:variable name="BrochurePageURL" />"><actinic:variable name="BrochureName" /></a>
__________________
Norman - www.drillpine.biz
Edinburgh, U K / Bitez, Turkey
Reply With Quote
  #36  
Old 25-Apr-2010, 12:39 AM
globalee globalee is offline
Registered User
Join Date: Jun 2009
Full Name: lee
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Smile

Quote:
Originally Posted by NormanRouxel View Post
If you mean link to a Brochure page, then all you need is:
Code:
<a href="<actinic:variable name="BrochurePageURL" />"><actinic:variable name="BrochureName" /></a>
actually need to link to product from brochure fragment

also lost the preview of the whole site, and online preview not working aslo??

however the cosde is working for the marketing list.

i want to add it to the code for the slide on th efront page of th esite,

http://www.novadetox.co.uk

cheers, lee
__________________
http://www.novadetox.co.uk
Reply With Quote
  #37  
Old 26-Aug-2010, 12:42 PM
PatchworkRabbit's Avatar
PatchworkRabbit PatchworkRabbit is offline
Registered User
Join Date: Sep 2009
Full Name: Karla Jordan
Posts: 274
Thanks: 28
Thanked 8 Times in 7 Posts
Nothing helpful to add, but I've just tried this and it works a treat in V9

Thanks chaps!
__________________
The Patchwork Rabbit
Reply With Quote
  #38  
Old 21-Nov-2010, 12:04 PM
bangers's Avatar
bangers bangers is offline
Developers
Join Date: Jul 2003
Full Name: lee bainbrigge
Posts: 339
Thanks: 2
Thanked 0 Times in 0 Posts
Why hasn't this been developed to come out of the box in v10?

This would be great if I could get it to work.
I've tried a few times now but always get the same error, no doubt I'm a duffus and should see something glaringly wrong but in v10 in preview mode (not going live unless someone tells me it sorts it's self by publishing live) the links fro SPP return:

Quote:
Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 354 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 356 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 357 Warning: odbc_close(): supplied argument is not a valid ODBC-Link resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 360 Notice: Undefined variable: parentid in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 361 Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 372 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 374 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 375 Warning: odbc_close(): supplied argument is not a valid ODBC-Link resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 378 Notice: Undefined variable: parentid in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 379 Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 336 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 338 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 339 Warning: odbc_close(): supplied argument is not a valid ODBC-Link resource in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 343 Notice: Undefined variable: url in C:\Program Files (x86)\Actinic v10\actinic_main.php on line 344
p.s lines
Quote:
$connect = odbc_connect("ActinicCatalog8","","");
Should this be the version number of actinic? in any case I tried with 8 without and with 10 all with the same result.

Any thoughts?... or will actinic get around to adding this as standard to new releases.

Regards
Bangers
__________________
Boxhedge New Media Design
Design and development solutions for SME's.
Tel: 0118 966 2786
Examples of work can be found at http://www.boxhedge.com
Reply With Quote
  #39  
Old 21-Nov-2010, 12:28 PM
Duncan Rounding's Avatar
Duncan Rounding Duncan Rounding is offline
Administrator
Join Date: Sep 2005
Full Name: Duncan Rounding
Posts: 10,283
Thanks: 123
Thanked 465 Times in 422 Posts
I can't comment on your code but the 8 does indeed need changing to 10 for the Actinic version.
Reply With Quote
  #40  
Old 21-Nov-2010, 12:32 PM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,752
Thanks: 9
Thanked 734 Times in 617 Posts
See http://community.actinic.com/showthread.php?t=48787 post #4, where earlier today I suggested two tweaks (to different code) that make it survive Actinic upgrades and also make it version number independent.

Should be easy to apply the same ideas to the above.
__________________
Norman - www.drillpine.biz
Edinburgh, U K / Bitez, Turkey
Reply With Quote
  #41  
Old 21-Nov-2010, 12:46 PM
bangers's Avatar
bangers bangers is offline
Developers
Join Date: Jul 2003
Full Name: lee bainbrigge
Posts: 339
Thanks: 2
Thanked 0 Times in 0 Posts
Um...apologies...
Just gave it one last shot, why not I thought after drounding replied so promptly. And well lets just say it works...leave it at that.
possibly didn't completely try it as $connect = odbc_connect("ActinicCatalog10","",""); maybe one forgot to close actinic and reopen..hmmm, sorry.

Anyway all good, amazing, sorts out major actinic flaw. I'll checkout Norman's update but thanks to Gabe for thinking outside the box.

p.s Thanks to Drounding for reply.

Cheers
A happy bangers
__________________
Boxhedge New Media Design
Design and development solutions for SME's.
Tel: 0118 966 2786
Examples of work can be found at http://www.boxhedge.com
Reply With Quote
  #42  
Old 21-Nov-2010, 12:58 PM
bangers's Avatar
bangers bangers is offline
Developers
Join Date: Jul 2003
Full Name: lee bainbrigge
Posts: 339
Thanks: 2
Thanked 0 Times in 0 Posts
Forget v10 cleaner cart/checkout aside, had actinic announced this with v10 launch and they may have had more enthusiasm for the update.

This is major as far as I am concerned and should be AUG asap.

Regards
bangers
__________________
Boxhedge New Media Design
Design and development solutions for SME's.
Tel: 0118 966 2786
Examples of work can be found at http://www.boxhedge.com
Reply With Quote
  #43  
Old 05-Dec-2010, 05:24 PM
completerookie completerookie is offline
Registered User
Join Date: Jul 2005
Full Name: kevin furze
Posts: 1,206
Thanks: 1
Thanked 29 Times in 24 Posts
been trying to implement this bit of php code because the code I wrote didn't work , so I used this example and I run into difficulties every so often.
I think ? narrowed it down to any product reference with a hyphen in, so for instance, "tc005" - ok, "Xeryu" - ok, "g5-classic" - NO GO
I've experimented with others and anything without hyphens seems to be fine, but the moment I use the hyphens, then it can't find the parentID from within GetProdParent()

Am I missing something, or do I need to "translate" it into html entitites before calling the ODBC link ?

kev
Reply With Quote
  #44  
Old 27-Oct-2013, 05:56 PM
Buzby's Avatar
Buzby Buzby is offline
Registered User
Join Date: Feb 2004
Full Name: Jason
Posts: 841
Thanks: 88
Thanked 34 Times in 30 Posts
If i now try to use this on Sellerdeck 2013, is it still valid?

Do i just change the version number, or has ActinicCatalog also changed

("ActinicCatalog8","",""); change this to ("ActinicCatalog12","",""); or ("Sellerdeck12","","");

Sellerdeck, can you not just include this in the future?
Reply With Quote
  #45  
Old 27-Oct-2013, 06:37 PM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,752
Thanks: 9
Thanked 734 Times in 617 Posts
ActinicCatalog12 is what's used for SD 2103. Also see post #40 above that links to a way to make it version independent.
__________________
Norman - www.drillpine.biz
Edinburgh, U K / Bitez, Turkey
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.