Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Wordpress Article Manager


GMTTDAN

Recommended Posts

I've released my first version of wordpress article manager for OSC. It basically allows you to add articles / content to OSC using wordpress, and displays them by category.

This is the support / questions topic.

Here is the contribution:

http://www.oscommerce.com/community/contributions,4522

Here is a demo:

http://www.gmtt.co.uk/v5

 

I anyone can tell me howto put a link to this topic in the contribution description feel free. Also mess around with it as you please. Anyone feel like adding pagination? ;)

Link to comment
Share on other sites

Thanks for the contribution i have been looking for something like this to impliment into my site. after installation all I get is a blank body. Header, footer, column left is all there but it's not pulling anything from the wordpress database. any suggestions? I have a few plugins installed on wordpress WP-Polls,Photopress,Opt-in Front Page, and BAStats. I have tried deactivaitng them but still no go. I also tried switching back to the default theme and still nothing?? I am using wordpress v2.0.3.

Link to comment
Share on other sites

Have you set the mysql details correctly in both the files?

You should see lines looking like this:

mysql_connect("localhost","","");

@mysql_select_db("") or die( "Unable to select database");

 

You need to fill them in with your wrdpress details from wp-config.php

The format is mysql_connect("localhost",MYSQL USERNAME"","MYSQL PASSWORD");

@mysql_select_db("MYSQL DATABASE") or die( "Unable to select database");

 

If it still does not work, i'll be interested as to why, though it sounds as if it might be mysql details, especially if it is not showing the categories.

Link to comment
Share on other sites

Yeah i'm sure it can. Just go to the language file and where you would put your text put include ("content.php");

 

I'd like to add the author and date to the posts. How do I do this? Also the content.php still has blog.php listed under the breadcrumbs.

Edited by mpm
Link to comment
Share on other sites

Yeah i'm sure it can. Just go to the language file and where you would put your text put include ("content.php");

 

This didn't work for me. Can you be more specific?

 

I added it to this section of languages/english/index.php: define('TEXT_MAIN', 'include ("content.php")');

Link to comment
Share on other sites

  • 11 months later...

Thanks for a great contrib- so simple...

 

It almost works for me!!!

 

I get the little box with the articles listed from my wordpres DB (i put them in my column_right.php), but when i click on them content.php displays the foreboding error message -Unable to select database

 

The wierd thing is I have copied and pasted the same database details from the wpcats.php file, which works.

 

I can only think that mysql doesnt like the second access. This leads me to believe I should get wpcats.php to close the db connection once its got its info.....It doesnt appear to do that - can anyoen tell me how to ?

Edited by Pensive
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 3 weeks later...
  • 3 weeks later...
  • 2 months later...

I would imagine that GMTTDAN doesn't even use OSC anymore - much less come to this forum. That's the problem with contributions..... they are great if you happen to find one WHILE the developer is actually making it... but anything more than a few weeks after that and your pretty much on your own.

 

I cant tell you HOW MANY TIMES this same thing has happened to me.

 

And of all things that would be useful for OSC to have integrated... WORDPRESS (and news modules in general) is most certainly one of them. Too bad only 2 contributions have ever been made that have anything to do with Wordpress and both are from 2006. And what's more both of creators are seemingly unreachable as well.

 

Prove us WRONG devs - please! :D We would all thank you very much!!!

Edited by CLRH2O
Link to comment
Share on other sites

  • 4 weeks later...

can I just add to this

 

this would be ideal for our site as well

 

at present the best i can do is to make osc and wp just look the same and it is useful but i could really do with more integration and i cant believe that there are only 2 contribs listed!

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
anyone figure out how to implement this contribution?

 

 

I really need a wordpress /blog that integrates with osc.

 

But it seems this is all geared towards an older version - I am using rc2.2a and of course the latest Wordpress version.

 

Have you any idea how to integrate the two? I googled it and once again, everything seems geared to older versions (with instructions that are not relevent to recent versions).

 

Thanks for your suggestion!

Sol

Link to comment
Share on other sites

OK - I have done the research and got this working.

 

For anyone interested, I have done all the hard work! Here is the solution:

 

1) There are two types of wordpress blogs:

 

 

A. web based (restricted functionality, but easier to deal with)

the web based wordpress can be found here:

www.wordpress.com

 

B. server based - ie you download this programme, then configure, then upload to your webhost and configure to match your website

the downloadable version is here:

www.wordpress.org

 

You can read about the differences here:

http://faq.wordpress.com/2006/05/07/wordpr...s-wordpressorg/

 

 

2) I chose to download and integrate the wordpress feed into my site

http://michaelwender.com/2006/10/06/embedd...mmerce-part-ii/

 

In case the above link doesn't work, here's the info

1. First, you will need to install OSC MS2.2 on your web server. This tutorial will assume that your OSC install is located in the default location for a typical OSC install: http://yourdomain.com/catalog/.

2. Next, install WordPress in the /catalog/ directory (i.e. http://yourdomain.com/catalog/wordpress/). Once you’ve installed WordPress, login to your WordPress admin and set Options > General > Blog address (URI) to “http://yourdomain.com/catalog/blog.php” (Note: If you would prefer to have your blog file named something other than blog.php, be sure to set this value accordingly and rename the file that you upload in step 4).

3. Now, just after the opening comments of the /catalog/includes/application_top.php file, add the following PHP code:

 

// turn off WordPress themes and include the WordPress core:

define('WP_USE_THEMES', false);

require('./wordpress/wp-blog-header.php');

 

4. Next, download these two files (blog.php and stylesheet.blog.css) and place them in the root of your OSC install.

 

Additional Refinement: Displaying Blog Headlines on your Catalog Homepage

For added functionality, here are instructions for including a WordPress static page and blog headlines on the homepage of your OSC store:

 

1. Before making this edit, you’ll want to make a backup of your default OSC homepage by renaming the file /catalog/index.php to index.ORIGINAL.php

2. Now, download this new index.php file and upload it to your /catalog/ directory. This new index file will display your last 4 blog headlines in a column on the right of the page body. Plus, the value for TEXT_MAIN found in /catalog/includes/languages/english/index.php will display in the left column of the page body.

3. In addition, starting on line 292 of this new index file, I have a switch inserted that will check for the presence of Vito Tardia’s Improved Include Page WordPress Plugin. If you install Vito’s plugin in WordPress, you can edit the iinclude_page() function call on line 294 to include the contents of any WordPress static page by simply editing the page ID in the function’s arguments.

 

FYI, I am using OSC RC2.2a, Wordpress 2.6.1, STS, HTC and a number of other contribs

www.boomskateboarding.com/store2/mobbblog.php

 

I'm still working on the actual use of the blog, so don't expect too much in the way of instruction on how to use it, or content on the above!

 

I will upload all of this as a contribution when I have chance, but for now the instructions above should be enough.

 

Regards

Sol

Link to comment
Share on other sites

  • 4 months later...
  • 4 weeks later...
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/themancaveoutletstore.com/httpdocs/content.php on line 108

 

Is it possible that wordpress changed their structure of the db !!!

 

I m getting the error that Table wp_categories does not exist (it doesnt. Should it be there?)

)

Link to comment
Share on other sites

Is it possible that wordpress changed their structure of the db !!!

 

I m getting the error that Table wp_categories does not exist (it doesnt. Should it be there?)

)

I started fiddling with this last night and found the required table was not there. I could not get it to create by making new categories. I am new to wp, so I lot of suck and see is happening.

 

In wp_cats.php, I made some changes that you can just replace the existing code with. They may work for you, as I said, I have only just begun to play with this on my test site.

 

$query="SELECT ID, post_title from wp_posts ORDER BY post_category ASC limit 10";

$result=mysql_query($query);

$num=mysql_numrows($result);

$result = mysql_query ($query) or die(mysql_error());

 

$i=0;

while ($i < $num) {

$artist=mysql_result($result,$i,"ID");

$title=mysql_result($result,$i,"post_title");

 

$info_box_contents[] = array('text' => "<a href = 'content.php?cat=$artist'>$title</a>");

 

But I have a lot more fiddling to see it this is what I want.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...