1
pulapol
How to make a module renameable and cloneable ?
  • 2010/2/19 14:40

  • pulapol

  • Just popping in

  • Posts: 55

  • Since: 2008/4/6 1


Hi...

i'm trying to make a simple seo content module for my website

i'm a php beginner...trying to learn make module by looking at other module to follow as a guide..so far so good..but sadly my coding is not following the standards...have more to learn

ok one of the thing that i want to do in my module is to make my module renameable and cloneable

...i saw this code in trabis dummy module - xoops_version.php
which can make our module folder renameable ..i had incorporated in my module
$modversion['dirname'] = basename(dirname(__FILE__));
$modversion['name'] = ucfirst(basename(dirname(__FILE__)));


what about the database table ? MySQL query ?

how do i do it

as example how do i change tthe code below so it can be renameable and clone multiple times...?


CREATE TABLE `mycontent_details` (
  `
idint(10unsigned NOT NULL auto_increment,
  `
filenamevarchar(200) default NULL,
  `
metakeywordsmediumtext,
    `
metadescriptionmediumtext,
    `
pagetitlemediumtext,
    `
doctitlemediumtext,
    `
contentmediumtext,
  
PRIMARY KEY  (`id`)
ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=;


global $xoopsDB
mysql_query("DELETE from ".$xoopsDB->prefix("mycontent_details")." where id='" $_GET['del'] . "'");




what else should i look into beside above..im a php beginnner..help..


p/s : sorry for my ppor english and please ignore the wrong fieldtype and value

2
ghia
Re: How to make a module renameable and cloneable ?
  • 2010/2/19 15:36

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The clone module can propose a clone function, which has to copy mysql.sql to clonename.sql changing the tablenames to clonename_tablename.
This file will be used to generate the tables in the database.
I believe eg Ghost 2.0 has such function, altough it mingles the language for an obscure reason in the SQL naming.
In xoops_version is also a pointer to the right sql file.

3
pulapol
Re: How to make a module renameable and cloneable ?
  • 2010/2/19 17:23

  • pulapol

  • Just popping in

  • Posts: 55

  • Since: 2008/4/6 1



where can i download it ?

4
pulapol
Re: How to make a module renameable and cloneable ?
  • 2010/2/21 9:26

  • pulapol

  • Just popping in

  • Posts: 55

  • Since: 2008/4/6 1


Here's a good read...


http://xoops.peak.ne.jp/md/d3forum/index.php?post_id=1500


still trying to understand it

Login

Who's Online

166 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 166


more...

Donat-O-Meter

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

Latest GitHub Commits