You are here:  » Changed defult url in wordpress


Changed defult url in wordpress

Submitted by shaunmac on Wed, 2012-12-05 22:07 in

I changed my defult url in wordpress and it messed everything up. I have since changed it back in my config file and mysql but it still is not working and I cant access the backend anymore. {link saved} . My price tapestry install is still working but wordpress is all messed up. Any thoughts on how to fix?

Submitted by support on Thu, 2012-12-06 09:24

Hi Shaun,

It looks like you're mostly back up and running now but I notice an oddity on a couple of your A-Z pages whereby the page image URL has become part of the page title. These are normally derived from the A-Z [Index] Title templates (wp-admin > Settings > PriceTapestry.org) and whilst image code could certainly be inserted at that point it would be necessary for clean titles to ensure that the HTML is stripped from it before generating the page title. Not sure if you were aware of that but if there are more pressing issues still let me know or if you're not sure re this point i'll help you out with the mods to enable an image title for the A-Z pages...

Cheers,
David.
--
PriceTapestry.com

Submitted by shaunmac on Thu, 2012-12-06 16:58

yeah the weirdest thing, not sure what happened but it seems to be back and running. I have two issues and I think I will be done with this site, one I implemented your code in the tread http://www.pricetapestry.org/node/283 and it worked but my images are coming up broken. They work fine on my products page so im guessing its simply an error in where the image url is pointing, but not sure where or how to change it. The other thing was to add a merchant and brand description on search pages. Exp. if I click on a-z merchants and select a merchant it gives me a little description and possibly a rating of the merchant and then have all there products underneath. I would like to do this for both merchants and brands. Thanks again in advance your support is great!

Submitted by support on Fri, 2012-12-07 10:14

Hello Shaun,

Regarding /node.283, my apologies I had not declared $pto_config_externalBaseHREF as global in the modification so that would explain the broken images. I've corrected the code in that thread by adding the following line at the top of the new code:

    global $pto_config_externalBaseHREF;

Merchant and Brand descriptions can be implemented easily using the simple .html file method that let's you incorporate arbitrary HTML content above the (page 1) search results for any merchant or brand.

To implement this, first create a /info/ folder in your Price Tapestry installation folder, and within that folder create Merchant Name.html and/or Brand Name.html files (the name must match exactly how the merchant / brand name appears on your site, including space) for example

/pt/info/Advanced MP3 Players.html
/pt/info/Sony.html

Then in pto_search.php look for the following code at line 329:

    $html .= pto_search_banner();

...and REPLACE with:

    if (($pto_page==1) && (($parts[0]=="merchant") || ($parts[0]=="brand")))
    {
      global $pto_config_externalPath;
      $infoFilename = $pto_config_externalPath."info/".$parts[1].".html";
      if (file_exists($infoFilename))
      {
        $html .= file_get_contents($infoFilename);
      }
    }
    $html .= pto_search_banner();

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by shaunmac on Fri, 2012-12-07 16:53

Tried to make the merchant info page and I get the following error

Parse error: syntax error, unexpected T_STRING in /home/username/public_html/seeds/wp-content/plugins/pto/pto_search.php on line 332

Also what do I put in the .html folders?

Submitted by support on Fri, 2012-12-07 17:02

Hi Shaun,

Sorry about that - first line of the replacement should be:

    if (($pto_page==1) && (($parts[0]=="merchant") || ($parts[0]=="brand")))

(corrected above)

With that in place, let's say you have the merchant "Example Merchant". Create a file as follows containing the custom HTML you want to display at the top of the search results on page for that merchant:

/pt/info/Example Merchant.html

(where /pt/ is your Price Tapestry installation folder)

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by shaunmac on Fri, 2012-12-07 18:55

Instead of creating an html page for each would i somehow be able to use a csv file?

Submitted by support on Sat, 2012-12-08 16:18

Hi Shaun,

Sure - the only downside would be a possible performance issue if the CSV files become quite large but the code is straight forward. Create files merchant.csv and brand.csv (saved in /pt/info/ as per the above method) of the following format:

"Merchant 1","Merchant description 1"
"Merchant 2","Merchant description 2"
etc.

and

"Brand 1","Brand description 1"
"Brand 2","Brand description 2"
etc.

Then have a go with the following as an alternative replacement to that described above:

    if (($pto_page==1) && (($parts[0]=="merchant") || ($parts[0]=="brand")))
    {
      global $pto_config_externalPath;
      $infoFilename = $pto_config_externalPath."info/".$parts[0].".csv";
      $fp = fopen($infoFilename,"r");
      while(!feof($fp))
      {
        $line = fgetcsv($fp,0,",","\"");
        if($line[0]==$parts[1])
        {
          $html .= $line[1];
          break;
        }
      }
    }
    $html .= pto_search_banner();

Hope this helps!

Cheers,
David.
--
PriceTapestry.com