marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
How to embed cpshop in a PHP page

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « How to embed cpshop in a PHP page »
Welcome, Guest. Please Login or Register.
12/17/17 at 12:02:05
Home Help Search Login Register
   marty.net message board
   About cpshop
   Tutorials
   How to embed cpshop in a PHP page
(Moderator: Marty)
Pages: « 1 2 3 4 5 6 7 Reply Notify of replies Send the topic Print 
   Author  Topic: How to embed cpshop in a PHP page  (Read 64406 times)
Suzzie
Silver Dragon
***

Gender: female
Posts: 41



Boohoo!
   

Re: How to embed cpshop in a PHP page
« Reply #90 on: 05/30/09 at 07:41:16 »
Reply with quote Modify message

anyone care to create a "for dummies" explanation on how to insert the content into a wordpress page?

i tried pointing the script, via the homepage option, to a particular wordpress page, and put the content tag on it as well... no dice!  
Logged
WhatHo
Green Dragon
*

Posts: 8



Go Scots!
   

Re: How to embed cpshop in a PHP page
« Reply #91 on: 12/11/09 at 08:06:59 »
Reply with quote Modify message

I wouldn't bother.

Instead, create a normal php page outside of WP. Then link to it from your blog. To call in WP stuff like category links, RSS feeds etc., insert
Code:
<?php require('wp-blog-header.php'); ?>  
somewhere towards the top of the page. Then use the normal code for WP anywhere after that in the page.

You should be able to use loops, but you'll have to create your post (say) in a unique category, then use a query string to reference that unique category and fetch that unique post. Your post will also exist (unlinked) elsewhere, so you'd use robots.txt to make 'certain' that the search engines didn't  index that.

On a side note, for a general php page, you can use the following code to add anything you want to any thumbnail or product page. You could even use it to add genuinely unique title tags, meta description and your own description to a thumbnail page.

What it does is reference the url you want and then output whatever you fancy. Using switch statements, includes and a lot of manual labour you could make every page of your site genuinely unique. But you'd have to hope the affiliate didn't withdraw their shop from the affiliate programme.

Here's the basic code:


Code:
<?php  // from   http://www.daniweb.com/forums/thread16687.html
     $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
     if (!empty($_SERVER["QUERY_STRING"]))
     $url .= "?".$_SERVER['QUERY_STRING'];
if ($url=='http://www.mysite.com/cgi-bin/mystore/testphp.php?i=sk/shopkeeper/6813075/') {echo'stuff'}?>
Logged
quickheads
Green Dragon
*

Posts: 4



Go fly a homebuilt!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #92 on: 02/01/13 at 17:08:24 »
Reply with quote Modify message

I was getting a similar error to other users here:


Quote:
Content-Type: text/plain /index.php The configuration file (index.php.config) has not been generated. Please run cpadmin before proceeding.


To fix this I made a copy of the "cpshop.cgi.config" file in the root of my cpshop directory and renamed it to "index.php.config" (Which is the name of the file it's looking for in the error above.)

"cpshop.cgi.config" appears after you save your changes in cpadmin.

Hope this helps.

Cheers,
Dan Yager
QBA Editor
www.quickheads.com
« Last Edit: 02/01/13 at 17:09:28 by quickheads » Logged
quickheads
Green Dragon
*

Posts: 4



Go fly a homebuilt!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #93 on: 02/01/13 at 21:08:35 »
Reply with quote Modify message

I think I almost have this working.  I am trying to write a component view in Joomla that embeds the cpshop code.

The only problem is that internal links on the product pages lose their Joomla parameters:

Here's what I have so far:

http://www.quickheads.com/index.php?Itemid=141&option=com_qba&view=cpshop

I was able to add the parameters to the shop front page with a perl hack to the cpshop.cgi page:


Code:
$html =~ s/\?i\=/\?Itemid\=141\&option\=com\_qba\&view\=cpshop\&i\=/g;


I can't get these parameters added to the product pages though.  The internal links point back to index.php without anything after the ?

Here is my php:


Code:
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
$str = `/home/quickh7/public_html/cgi-bin/quickshop/cpshop.cgi "http://www.quickheads.com/index.php?Itemid=141&option=com_qba&view=cpshop" http://www.quickheads.com/cgi-bin/quickshop/cpshop.cgi $qs`;
echo $str;


I tried to add a similar hack to change the product page links like this:


Code:
$html =~ s/value\=\"http\:\/\/www\.quickheads\.com\/index\.php\"\>/value\=\"http\:\/\/www\.quickheads\.com\/index.php\?Itemid\=142\&option\=com_qba\&view\=cpshop\"\>/g;


but that didn't seem to do much.  These seem to be relative links.

Any help would be appreciated.

Thanks all,
Dan Yager
QBA Editor
www.quickheads.com
Logged
Pages: « 1 2 3 4 5 6 7 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright 2000-2001, X-Null. All Rights Reserved.