1
mikey
How can I create a page with product names and descriptions in Xoops?
  • 2002/8/2 16:15

  • mikey

  • Just popping in

  • Posts: 5

  • Since: 2002/6/8 1


Hi, could someone tell me if there is a module available or how to create a page within the XOOPS site which will just show for example a list of products that i offer perhaps where theres a thumb image of the product a nd a short description?? Or if you can point me to place where I can create an HTML page within the main page frame in XOOPS would be appreciated.

TIA

2
Herko
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/2 16:27

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Search the forums for a review module... someone was busy with one (or finished already) not so long ago, if I remember correctly. Somewhere on XoopsForge I believe...

Herko

3
mikey
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/2 20:49

  • mikey

  • Just popping in

  • Posts: 5

  • Since: 2002/6/8 1


Ok will scour around for one Herko

4
onokazu
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/2 21:14

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


I thought Sircuri is working on the mod..

5
mikey
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/2 21:29

  • mikey

  • Just popping in

  • Posts: 5

  • Since: 2002/6/8 1


Yeah it looks like he is but it hasnt been updated for a while, I guess busy on other projects. Is there any other way to get an HTML page showing in the main XOOPS page i.e. add a link to main menu and page opens up in center listing products and description etc.

6
MaxIT
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/2 22:53

  • MaxIT

  • Just popping in

  • Posts: 65

  • Since: 2002/11/8


Why don't you try to hack yourself an existing module?
If you need just a list with an image and a short description, you could use (i.e.) MyLinks as a base, and hack it removing those fields you don't need. Step by step you will reach the result.

An xoops.it user, without any knowledge of PHP or programming in general, has created a simple hack of MyLinks to complain his need to list "Associatons".

He has followed suggestions on what to change on files to have a perfect 'clone' without interferring with original version (suggestions are HERE, in italian, I will translate it if there's a need), and began to dig on files. Or you could download it and compare to original MyLinks files to discover how change and what.

7
mikey
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/3 9:32

  • mikey

  • Just popping in

  • Posts: 5

  • Since: 2002/6/8 1


Ok Guys, info very helpful - well i was up for a while last night and hacked into the Sections module of xoops, (roughly translating italian - I'll keep my day job i think) - and I now have a new Product Catalog module running - nice cos I can put products into categories and looks nice and neat.

I have by doing it this way 'lost' the sections module as it has now become 'Products' but still using the xoops_sections and xoops_seccont tables which I tried to work around as per your advice - I am going to work some more to create the 'Products' module seperate from the 'sections' module but I had a few problems and you could probably tell me whats wrong -this is what I did initially which didnt work but I would like it to:


rows:xoops_version.php
$$modversion['name ' ] = _ MI_PRODUCTS_NAME;
$$modversion['version ' ] = 1.00;
$$modversion['description ' ] = _ MI_PRODUCTS_DESC;

$modversion['dirname'] = "products";

rows: modinfo.php
// The name of this module
define("_MI_2SECTIONS_NAME", "products");
// To brief description of this module
define("_MI_2SECTIONS_DESC", "To add Products to the Product Catalogue.");

So far so good....

In xoops_version.php:

// Tables created by sql file (without prefix!)
$modversion['tables'][0] = "product";
$modversion['tables'][1] = "products";

This seems to fall over for me cos it wont create the new tables for some reason - I could have manually created them in phpmyAdmin but wasnt sure what the field values where...

Also changed in admin_header.php:

$xoopsModule = XoopsModule::getByDirname("products");



Do I not also need to edit admin\index.php because it has references in lines to:

function sections() { ////does this need to change?

$result = $xoopsDB->query("select secid, secname, image from ".$xoopsDB->prefix("sections")." order by secname") /////what does this change to?

Will also need to change line to include new module location name:

echo _MD_URLFORTHIS."<br>
<a href=\"".XOOPS_URL."/modules/<b>sections</b>/index.php?op=viewarticle&artid=$artid\">".XOOPS_URL."/modules/sections/index.php?op=viewarticle&artid=$artid</a>

Variables in \language\english\main.php and modinfo.php are easily changed.

It installed ok and worked to point where tried to add product but it didnt list it - the tables didnt create for xoops_product and xoops_products which is i suppose the problem - so I have what I want now but I want the above to work properly so the Products module is seperate from the sections module so if u have any ideas would appreciate it.

Sorry for the poor descriptions here....I am exhausted and know bugger all about PHP as you can tell i guess

8
MaxIT
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/3 10:45

  • MaxIT

  • Just popping in

  • Posts: 65

  • Since: 2002/11/8


Quote:

rows:xoops_version.php
$$modversion['name ' ] = _ MI_PRODUCTS_NAME;
$$modversion['version ' ] = 1.00;
$$modversion['description ' ] = _ MI_PRODUCTS_DESC;

$modversion['dirname'] = "products";

rows: modinfo.php
// The name of this module
define("_MI_2SECTIONS_NAME", "products");
// To brief description of this module
define("_MI_2SECTIONS_DESC", "To add Products to the Product Catalogue.");


if you use MI_PRODUCTS_NAME and MI_PRODUCTS_DESC, define them instead than MI_2SECTIONS_ ones who are only an example for a constant name for a 'clone'

Quote:

// Tables created by sql file (without prefix!)
$modversion['tables'][0] = "product";
$modversion['tables'][1] = "products";

This seems to fall over for me cos it wont create the new tables for some reason - I could have manually created them in phpmyAdmin but wasnt sure what the field values where...



go in /modules/sections/sql/mysql.sql: here's the script to build tables neeeded from sections module. If you change it in your new products module, when you 'install' it via XOOPS administration, tables will be automatically created. So instead of 'morphing' sections, try duplicating the whole directory /modules/sections, change MySQL files according to your new module scope (table name, primary, leave fields as they are at now) and iInstall it: XOOPS will create new tables for you.

Quote:

Do I not also need to edit admin\index.php because it has references in lines to:

function sections() { ////does this need to change?


better to change it ( to clear code) and all its calling in all your files under the /modules/YOURMODULENAME/ structure. Look and replace for "sections()" instead than "sections", otherwise you will get noyt only function but variable and cookie. You should change them too but make it step by step:


Quote:

$result = $xoopsDB->query("select secid, secname, image from ".$xoopsDB->prefix("sections")." order by secname") /////what does this change to?


if you didn't change fields name on mysql.sql file, you don't need to change anything here (at now: but if you decide to create a 'serious' module you should change them in mysql.sql and here too)

Quote:

Will also need to change line to include new module location name:

echo _MD_URLFORTHIS."<br>
<a href=\"".XOOPS_URL."/modules/<b>sections</b>/index.php?op=viewarticle&artid=$artid\">".XOOPS_URL."/modules/sections/index.php?op=viewarticle&artid=$artid</a>

Variables in \language\english\main.php and modinfo.php are easily changed.

It installed ok and worked to point where tried to add product but it didnt list it - the tables didnt create for xoops_product and xoops_products which is i suppose the problem - so I have what I want now but I want the above to work properly so the Products module is seperate from the sections module so if u have any ideas would appreciate it.



surely your problem is due to undefined constants for table names: if you define:

$modversion['tables'][0] = "product";
$modversion['tables'][1] = "products";

then modify mysql.sql changing
CREATE TABLE seccont
to
CREATE TABLE product
and changing
CREATE TABLE sections
to
CREATE TABLE products

Quote:


Sorry for the poor descriptions here....I am exhausted and know bugger all about PHP as you can tell i guess

This is the best way to learn programming: 'unmounting' code is funny exactly like destroying toys when you're children, just to discover how they're built

9
mikey
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/3 11:22

  • mikey

  • Just popping in

  • Posts: 5

  • Since: 2002/6/8 1


MaxIT, ur a star, will give it a go on testsite now.

Thanks for ur quick and generous help.

Mike

10
Herko
Re: How can I create a page with product names and descriptions in Xoops?
  • 2002/8/3 11:26

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


As a fellow-non-coder I must congratulate you on your efforts I tried once myself, but got stuck somewhere (tried to add an expriy date to news posts, and failed). Keep at it

Herko

Login

Who's Online

186 user(s) are online (89 user(s) are browsing Support Forums)


Members: 0


Guests: 186


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits