Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

yes there are other problems

 

table wp_categories is renamed wp_terms (at least in my db) so i made

 

this change to wp_cats at line 38

 

 $query="SELECT term_ID, name from wp_terms ORDER BY name ASC limit 10"; 
$result = mysql_query ($query)

 

 

but I dont know which table wp_post2cat is suposed to be so i get an error in content.php

Posted
yes there are other problems

 

table wp_categories is renamed wp_terms (at least in my db) so i made

 

this change to wp_cats at line 38

 

 $query="SELECT term_ID, name from wp_terms ORDER BY name ASC limit 10"; 
$result = mysql_query ($query)

 

 

but I dont know which table wp_post2cat is suposed to be so i get an error in content.php

I guess it will not work with the latest wordpress.

I'm looking at http://www.wposc.com/ but that is not out of the box for me either.

Posted

I changed lines 106 to 119 to this

 

	
$query="SELECT object_id from wp_term_relationships WHERE term_taxonomy_id = $category ORDER BY object_id DESC limit 10 "; 
$result=mysql_query($query); 
$num=mysql_numrows($result); 
$i=0; 
while ($i < $num) { 
$artist=mysql_result($result,$i,"object_id"); 

$query2="SELECT ID, post_content, post_title from wp_posts WHERE ID =  $artist limit 10"; 
$result2=mysql_query($query2); 
$num2=mysql_numrows($result2); 
$c=0; 
while ($c < $num2) { 
$postcontent =mysql_result($result2,$c,"post_content"); 
$posttitle=mysql_result($result2,$c,"post_title");

 

and I am not getting the error anymore and I see some blog post

 

Generally I am not happy with what i getting cause i have double categories in the box and my greek characters ara not showing well

  • 3 months later...
Posted

I've posted Wordpress Article Manager v2.0 on the contribution page:

 

http://addons.oscommerce.com/info/4522

 

Updates for v2.0 :

 

- Now works with Wordpress v2.7.1. Previous version used incorrect

table structure and failed.

 

- URL generated for page now uses the Wordpress category slug and post

name to ensure URLs are search engine friendly.

e.g.

Original URL... http://www.yourdomain.com/content.php?postid=5

v2.0 URL... http://www.yourdomain.com/articles.html?po...r-category-name

 

- Wordpress categories are listed in a table at the bottom of each article

page, complete with a list of articles which belong to each category. All

category and article listings are clickable links.

 

- Latest 10 posts are listed on main articles page with 150 character

snippets. All articles belonging to a specific category are listed on the

respective category page with snippets.

 

- Random products from catalog are displayed down left side of the page to

coax customer into purchases while reading articles.

 

Full credits to Dan Brown (GMTTDAN) for the original contribution !

 

Cheers

 

Andy

Posted
I changed lines 106 to 119 to this

 

	
cut

 

and I am not getting the error anymore and I see some blog post

 

Generally I am not happy with what i getting cause i have double categories in the box and my greek characters ara not showing well

 

my quick fix to the double posts was to edit wpcat.php into :

LINES: 35-43

  mysql_connect("localhost","m________1","O_________5"); 
@mysql_select_db("m________1") or die( "Unable to select database"); 
$query="SELECT ID, post_title, post_type from wp_posts where post_type = 'post' ORDER BY ID ASC limit 10  "; 
$result=mysql_query($query); 
$num=mysql_numrows($result); 
$i=0; 
while ($i < $num) { 
$artist=mysql_result($result,$i,"ID"); 
$title=mysql_result($result,$i,"post_title");

 

Pleas note that i changed the sql to just show titles of of the articles not categories. as always back it up first :P

Posted
my quick fix to the double posts was to edit wpcat.php into :

LINES: 35-43

  mysql_connect("localhost","m________1","O_________5"); 
@mysql_select_db("m________1") or die( "Unable to select database"); 
$query="SELECT ID, post_title, post_type from wp_posts where post_type = 'post' ORDER BY ID ASC limit 10  "; 
$result=mysql_query($query); 
$num=mysql_numrows($result); 
$i=0; 
while ($i < $num) { 
$artist=mysql_result($result,$i,"ID"); 
$title=mysql_result($result,$i,"post_title");

 

Pleas note that i changed the sql to just show titles of of the articles not categories. as always back it up first :P

im now having errors and stuff. please ignore my code till i fix it.

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...