11
philroy
Re: How to "clone" Tiny Content
  • 2003/9/6 9:00

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


Help?? Sorry...there's been no response to the errors when cloning that I've posted and I'm desperate.

Phil

12
Shine
Re: How to "clone" Tiny Content
  • 2003/9/6 9:24

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Quote:
I think that's all. If you have any problems, please post them here to make the necessary corrections.


Not quit
You forgot to mention the sql file. This file needs also to be corrected into name of his rewritten module.
Ie.:
Previous 'tinycontent'
New modname: 'mymodule' (sportsdraw)

Otherwise it doesn't connect to the correct DB tables of the rewritten TContent module.

grtz., Shine

[edit]

Wait a minute,.........within this tinycontent module I found a writing from its developer.
Open: modinfo.php
It says:
Quote:
//***********************************************************************//
// No language config below! Only if you want to change the Prefix //
// or the directory of the module! So you can sipmly duplicate this //
// module by copying it in another folder and change the settings below! //
// Also before install a clone change the prefix in the sql file! //
//***********************************************************************//

define("_MI_TINYCONTENT_PREFIX", "tinycontent");
define("_MI_DIR_NAME", "tinycontent");


Try to do exactly what he's saying here. Change both lines tinycontent into sportsdraw and open your sqlfile and change also tinycontent prefix into sportsdraw.
Upload, install and see what happens.

[/edit]

13
philroy
Re: How to "clone" Tiny Content
  • 2003/9/6 9:53

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


OK, really getting confused now! How does this relate to what was said earlier...in particular, Point 6 of the instructions caused errors. Do I still do that?

Perhaps a new list of instructions based on everything so far? If someone is willing? I was goingto but I'm getting it wrong.

Phil

14
philroy
Re: How to "clone" Tiny Content
  • 2003/9/11 1:48

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


OK, this is still not going well and I'd really like to try to use the module.

I've tried the suggestions here...even working a mix of the two suggestions together. While I can go through and prepare the module, one weird thing I have noticed is that once I think it is all done, and go into XOOPS ready to install it...Xoops thinks both modules (TinyContent and its Clone) are "sportsdraw" (the name of my clone) ??

This is weird...two separate folders...one named "sportsdraw" and one named "tinycontent"...neither of which has any reference to the other, but XOOPS insists on seeing their contents as almost the same?

Phil

15
hsalazar
Re: How to "clone" Tiny Content
  • 2003/9/11 4:31

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Philroy:

Sorry about the delay. Had lost track of this thread...

The procedure I outlined is all you need. I'll try to be more explicit here.

1) Replace every instance of "_TINYCONTENT_" with "_YOURMODULENAME_".
This means that for every appearance of _TINYCONTENT_ in the directory files, you should write _SPORTSDRAW_. I guess there's no problem here.

2) Replace every instance of "tinycontent" with "yourmodulename".
Same as above: every instance of "tinycontent" must be replaced by "sportsdraw". You won't find this difficult. And, Shine: the first lines of the file mysql.sql for the module read:
Quote:

#
# Table structure for table `tinycontent`
#

CREATE TABLE tinycontent (

This means that when doing the global replacement, now these lines will read:
Quote:

#
# Table structure for table `sportsdraw`
#

CREATE TABLE sportsdraw (

Which is necessary for XOOPS to separate the contents.

3) Replace every instance of "_TC_" with "_YOURMODULENAME_".
This means the same as in the above points: every instance of _TC_ must read _SPORTSDRAW_.


4) Change the names of three files:
-- blocks/tc_navigation.php
-- templates/tinycontent_index.html
-- templates/blocks/tinycontent_navigation_block.html


In this case the new files will be called:
-- blocks/sportsdraw_navigation.php
-- templates/sportsdraw_index.html
-- templates/blocks/sportsdraw_navigation_block.html

5) Replace the necessary language constants in the language files

This means that, for instance, in language/english/admin.php you have:

define("_TC_ADMINTITLE","Tiny Content");

and should have

define("_SPORTSDRAW_ADMINTITLE","Sports Draw");

Also, in language/english/modinfo.php you should replace the lines...

define("_MI_TINYCONTENT_NAME","Tiny Content");
define("_MI_TC_BNAME1","Tiny Content Menu");


for

define("_MI_SPORTSDRAW_NAME","Sports Draw");
define("_MI_SPORTSDRAW_BNAME1","Sports Draw Menu");


Please notice that the first part of the declarations was already changed by the global replacement. What you need to change here are the content strings, the right side of every definition.

6) And most important, open xoops_version.php and replace the two instances of "_MI_DIR_NAME" for "_MI_MODULENAME_DIR_NAME". In fact, also make this replacement directory wide.

This means exactly what it says. Every instance of _MI_DIR_NAME should end up saying _MI_SPORTSDRAW_DIR_NAME.
You need to make this replacement in the files index.php, xoops_version.php (two instances here, one pointing to the table name and the other to the directory name), admin/admin_header.php, admin/index.php, and in every modinfo.php file within the language directories.

I'll add these comments:

a) You also need to edit the logo file, so you can separate your module from the original Tiny Content in the admin section.

b) If XOOPS gets confused is because of the DIR variable mentioned in point [6]. That's why it's so important to do the replacement correctly. XOOPS should know for sure that module A is installed in directory A and has a database table A, while module B is installed in directory B and has a database B. If you don't make the replacements correctly, you'll confuse XOOPS.

All this sounds complex because I wanted to be thorough, but in fact, once you do it a couple of times you'll see it's really simple.

Again, if you still have any problems, please post them here to make the necessary corrections.

Cheers.

16
philroy
Re: How to "clone" Tiny Content
  • 2003/9/11 5:57

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


Hmm....well I'm not sure just what it is that I've been doing wrong....and your instructions (despite being more detailed THANKS! seem the same as before)....but after all that and a bit of frustration, I reinstalled XOOPS locally and calmly started again.

End result? Success

Thank you so much for all your time and effort.

Cheers,

Phil

17
Shine
Re: How to "clone" Tiny Content
  • 2003/9/12 23:49

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Hsalazar is right. A few days ago I've tried to clone this module myself.
That what is put by its developer within the modinfo file:
Quote:
//***********************************************************************//
// No language config below! Only if you want to change the Prefix //
// or the directory of the module! So you can sipmly duplicate this //
// module by copying it in another folder and change the settings below! //
// Also before install a clone change the prefix in the sql file! //
//***********************************************************************//

define("_MI_TINYCONTENT_PREFIX", "tinycontent");
define("_MI_DIR_NAME", "tinycontent");

Doesn't work at all for cloning.
You have to rename everything.

Grtz., Shine
(lost also track of this thread sorry for my late respond.)

18
bassyard
Re: How to "clone" Tiny Content
  • 2003/10/6 1:52

  • bassyard

  • Not too shy to talk

  • Posts: 157

  • Since: 2003/10/5


I had the same problem, now everything is changed as it said in this topic. Now I've got a new problem:
When I want to install my module (which is called "Artist Content") it give this error during the install:

Quote:
You have an error in your SQL syntax near 'artistint(1) NOT NULL default '0', homepage artistint(1) NOT NULL default '0'' at line 6

Unable to install artistcontent. Error(s):


here's a copy of mysql.sql:

Quote:

#
# Table structure for table `artistcontent`
#

CREATE TABLE artistcontent (
storyid int(8) NOT NULL auto_increment,
blockid int(8) unsigned NOT NULL default '0',
title varchar(255) NOT NULL default '',
text text default NULL,
visible artistint(1) NOT NULL default '0',
homepage artistint(1) NOT NULL default '0',
nohtml artistint(1) NOT NULL default '0',
nosmiley artistint(1) NOT NULL default '0',
nocomments artistint(1) NOT NULL default '0',
link artistint(1) NOT NULL default '0',
address varchar(255) default NULL,
PRIMARY KEY (storyid),
KEY title (title(40))
) TYPE=MyISAM;


Does somebody know what this means (my programming knowledge isn't that good )

greetz Bassyard

19
philroy
Re: How to "clone" Tiny Content
  • 2003/10/6 2:25

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


Yeah....you've got a bit carried away with the term 'tiny'...which is also used in mySQL.

It should be...

Quote:
#
# Table structure for table `artistcontent`
#

CREATE TABLE artistcontent (
storyid int(8) NOT NULL auto_increment,
blockid int(8) unsigned NOT NULL default '0',
title varchar(255) NOT NULL default '',
text text default NULL,
visible tinyint(1) NOT NULL default '0',
homepage tinyint(1) NOT NULL default '0',
nohtml tinyint(1) NOT NULL default '0',
nosmiley tinyint(1) NOT NULL default '0',
nocomments tinyint(1) NOT NULL default '0',
link tinyint(1) NOT NULL default '0',
address varchar(255) default NULL,
PRIMARY KEY (storyid),
KEY title (title(40))
) TYPE=MyISAM;


In other words, only put "artistcontent" in two places.

Phil

20
bassyard
Re: How to "clone" Tiny Content
  • 2003/10/6 10:27

  • bassyard

  • Not too shy to talk

  • Posts: 157

  • Since: 2003/10/5


Thanx Philroy!!!

you are the best, it works now!!!
This is all very new to me

greetz bassyard

Login

Who's Online

449 user(s) are online (285 user(s) are browsing Support Forums)


Members: 0


Guests: 449


more...

Donat-O-Meter

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

Latest GitHub Commits