Jump to content
Sign in to follow this  
GMTTDAN

[Contribution] Wordpress Article Manager

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? ;)

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Does/Can this contribution replace the index as per the Wordpress Integration 1.1 contribution? I see from your site that you don't have the blog on your start page.


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
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

For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
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")');


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

I managed to get the blog entry authors showing on the posts but only the user id number is showing. How would I get authors showing properly?


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I am getting:

 

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/manifest/loveculture/includes/boxes/wpcats.php on line 39

 

What directory should the content.php file be uploaded to? Maybe this is what I am doing wrong

Share this post


Link to post
Share on other sites

I am also getting the error mysql_numrows(): supplied argument is not a valid MySQL result resource in .../public_html/shop/includes/boxes/wpcats.php on line 39 - any ideas?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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


Yeah Yeah I am learning as I go... lol

Share this post


Link to post
Share on other sites
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?)

)

Share this post


Link to post
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.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Ignore the above, there are other problems.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×