11
jegelstaff
Re: Perl script for cloning WF-Channel

I should mention that this script was written for WF-Channel 1.06.

--Julian

P.S. Seems I made too many edits to my original post, newbb2 won't let me edit it anymore! Can someone please turn off whatever setting is preventing me from editing my own post, people should always be able to edit their own words.

10
jegelstaff
Re:Perl script for cloning WF-Channel

Quote:

jegelstaff wrote:
Sure, anyone can hack up something like this fairly easily,


I should say, anyone who knows a bit of Perl can!

I didn't mean to imply that anyone should be able to do this, and if you can't, then there's something wrong. There is defintely a little specialized knowledge at work.

--Julian

9
jegelstaff
Re:Perl script for cloning WF-Channel

So I take it you got it working?

Basically, download ActiveState Perl and install it on your windows machine.

Then put the WF-Channel files and the script in a new folder as described above.

Then run the script from the DOS box as described above.

And if you got the message saying the new module was ready, then you should be good to go.

Good luck,

--Julian

P.S. About how it works...it's actually a very, very simple script, as far as Perl scripts go. All it does is grab the command line arguments that you pass it (the new name you want for the module) and then does a whole bunch of find and replace operations on the files in the wf-channel module.

Perl is a programming language that is very well suited to text file manipulation (and was the scripting language of choice before PHP came along). Many still swear by Perl though, the programmer's "swiss army knife" it has been called.

The ActiveState program is simply the environment you need installed to make Perl work (on windows). The .pl script is just plain text and you need to have ActiveState in order for your computer to be able to read the file and know what to do.

It's kind of like how you need a web server with PHP installed for your PHP files to be read and interpreted correctly. Perl is a programming language just like PHP.

8
hawkeyegop
Re:Perl script for cloning WF-Channel
  • 2005/1/4 22:57

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


OK, I guess that worked. THanks a lot!

Now if I was smart enought I would write something like this. But I don't understand how thing works at all!

Chris

7
hawkeyegop
Re:Perl script for cloning WF-Channel
  • 2005/1/4 21:00

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


I did read that first post, and downloaded the Perl script. I was referring to his next post, where he mentioned some Windows program or something.

I have the Perl script but don't know what to do with it, that is what I'm saying.

Thanks,

Chris

6
Bender
Re:Perl script for cloning WF-Channel
  • 2005/1/4 20:16

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Quote:

hawkeyegop wrote:
Could anyone give me pointers on this? I don't even really know what to do. I was going to download that program thing, but it was a weird file extension and I wasn't sure how to proceed.

Thanks


Uhh you read the first posting completely?

As in that post beginning under "Notes" jegelstaff explained what you need to run that "weird" file extension. (which stands actually just a perl script)

5
hawkeyegop
Re:Perl script for cloning WF-Channel
  • 2005/1/4 20:09

  • hawkeyegop

  • Just popping in

  • Posts: 83

  • Since: 2004/9/18


Could anyone give me pointers on this? I don't even really know what to do. I was going to download that program thing, but it was a weird file extension and I wasn't sure how to proceed.

Thanks

4
jegelstaff
Re:Perl script for cloning WF-Channel
  • 2004/10/23 17:50

  • jegelstaff

  • Module Developer

  • Posts: 518

  • Since: 2004/7/2 2


Sure, anyone can hack up something like this fairly easily, and if someone wants to use this script as a starting point for a similar script for another module, go right ahead.

For anyone attempting this kind of thing, here's the basic structure of the code (though it's so simple, anyone should be able to figure it all out):

1. Grab the command line arguments

2. Setup the variables you need for changing text later on (the names of the template files, etc)

3. Open up the xoops_version.php file and put the contents in a string.

4. Do a series of search and replace operations based on the new names. This is the part that will be unique for each module of course; what you search for will be different.

5. Overwrite the file with the new text you just searched and replaced on.

6. Repeat 3 to 5 for all files in the module that need changing. That's the other part that will be unique for each module -- the number of files that you have the do operations on, and what changes you have to make in them.

7. Rename any files that need renaming. Another unique operation.

They way WF-Channel is cloned here should be a good guide. Here's a good overview of what's required to clone a module:

https://xoops.org/modules/news/article.php?storyid=1714

Good luck!

--Julian

3
usera
Re:Perl script for cloning WF-Channel
  • 2004/10/23 10:42

  • usera

  • Just popping in

  • Posts: 29

  • Since: 2004/8/28


is it possible to edit your perl script to use for other modules for xoops? It would serve as a multipurpose tool

2
jegelstaff
Re: Perl script for cloning WF-Channel
  • 2004/10/21 19:12

  • jegelstaff

  • Module Developer

  • Posts: 518

  • Since: 2004/7/2 2


FYI: the script has been updated to make a few more changes in the cloned copy -- change name of sql file, and names of the search and comment functions. Renaming the search function is actually necessary in order to avoid a fatal error on the userinfo.php page of your site. So on the off chance that anyone has grabbed a copy of this and used it, we highly recommend manually making these new changes, or starting over.

--Julian

Login

Who's Online

256 user(s) are online (180 user(s) are browsing Support Forums)


Members: 0


Guests: 256


more...

Donat-O-Meter

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

Latest GitHub Commits