1
bumpeboy
How can i rename a module
  • 2010/3/1 4:29

  • bumpeboy

  • Friend of XOOPS

  • Posts: 170

  • Since: 2008/10/4


In the Admin section i can see install install, info, activate and deactivate. But where is rename?

2
xsell
Re: How can i rename a module
  • 2010/3/1 7:36

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


wht do you want to do exactly .. rename a module not one click Do .. if you meant change the title then from admin area click Modules to the left is the modules list u can change the title to any thing ..

but if you mean to rename Module for Example newbb to forum .. there some steps u need to do .

1- change the module folder Name
2- search the whole module for the old name and replace it with the new name .. for Fast way . use Notepad++ in the search box search in the whole module files for newbb and replace it with forum

3- Search for any php,html,css,js... any file includes newbb wht it name and change it to forum .. example
newbb_tpl.html to forum_tpl .. newbb.png to forum.png

then install the module .. but if the module already installed un-install it .. rename it and then install .. if you can not uninstall it and want to rename it while still installed this is another story and needs more time to excplain.



3
kris_fr
Re: How can i rename a module
  • 2010/3/1 11:29

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


Quote:
but if you mean to rename Module for Example newbb to forum .. there some steps u need to do .

make a file clone.php with (eq : news name module in memo name module):
<?php 
/* 
Usage: 

    Copy clone_news.php in <xoops_root> 
    Change current working directory to <xoops_root> 
    Update mappings as per new modulename. 

    php -q clone_news.php 

*/ 

// ########################################################## 
//    Define your mapping here 
// ########################################################## 
$patterns = array( 
  
// first one must be module directory name 
  
'news'  => 'memo'
  
'NEWS'  => 'memo'
  
'News' => 'Memo'
  
'stories' => 'memo_stories'
  
'topics' => 'memo_topics'
  
'_MI_' => '_MI01_',
  
'Articles' => 'Memo',
  
'getmoduleoption' => 'memogetmoduleoption'
  
'MygetItemIds' => 'memoMygetItemIds'
  
'CreateSiteNavBar' => 'memoCreateSiteNavBar'
  
'updateCache' => 'memoupdateCache'
  
'TableExists' => 'memoTableExists'
  
'FieldExists' => 'memoFieldExists'
  
'AddField' => 'memoAddField'
  
'is_admin_group' => 'memois_admin_group'
  
'make_infotips' => 'memomake_infotips',
  
'DublinQuotes' => 'memoDublinQuotes',
); 

$patKeys array_keys($patterns); 
$patValues array_values($patterns); 

// work around for PHP < 5.0.x 
if(!function_exists('file_put_contents')) { 
  function 
file_put_contents($filename$data$file_append false) { 
    
$fp fopen($filename, (!$file_append 'w+' 'a+')); 
    if(!
$fp) { 
      
trigger_error('file_put_contents cannot write in file.'E_USER_ERROR); 
      return; 
    } 
    
fputs($fp$data); 
    
fclose($fp); 
  } 


// recursive clonning script 
function cloneFileFolder($path

  global 
$patKeys
  global 
$patValues

  
$newPath str_replace($patKeys[0], $patValues[0], $path); 

  if (
is_dir($path)) 
  { 
    
// create new dir 
    
mkdir($newPath); 

    
// check all files in dir, and process it 
    
if ($handle opendir($path)) 
    { 
      while (
$file readdir($handle)) 
      { 
        if (
$file != '.' && $file != '..'
        { 
          
cloneFileFolder("$path/$file"); 
        } 
      } 
      
closedir($handle); 
    } 
  } 
  else 
  { 
    if(
preg_match('/(.jpg|.gif|.png|.zip)$/i'$path)) 
    { 
      
copy($path$newPath); 
    } 
    else 
    { 
      
// file, read it 
      
$content file_get_contents($path); 
      
$content str_replace($patKeys$patValues$content); 
      
file_put_contents($newPath$content); 
    } 
  } 


cloneFileFolder('modules/news'); 

echo 
"Happy cloning...n"
echo 
"check directory modules/" $patterns['news'] . " for cloned module n"
echo 
"Consider modifying new module by editing language/english/modinfo.php and images/" $patterns['news'] . "_slogo.png manually (if you care)n"

?>


@+

4
bumpeboy
Re: How can i rename a module
  • 2010/3/1 13:41

  • bumpeboy

  • Friend of XOOPS

  • Posts: 170

  • Since: 2008/10/4


Quote:

xsell wrote:

but if you mean to rename Module for Example newbb to forum .. there some steps u need to do .



This is what I mean, before it used to be as simple as renaming the module and press the submit button, now it sound like rocket science.

5
sailjapan
Re: How can i rename a module

I think you've been misunderstood.
I think Bumpeboy just wants to change the displayed name.

Admin>Control Panel Home>modules> type the new name under the module you want to rename and click 'submit' at the bottom of the page, then click 'submit' on the confirmation page that appears.

6
bumpeboy
Re: How can i rename a module
  • 2010/3/1 18:44

  • bumpeboy

  • Friend of XOOPS

  • Posts: 170

  • Since: 2008/10/4


Quote:

sailjapan wrote:
I think you've been misunderstood.
I think Bumpeboy just wants to change the displayed name.


Yes thats what i mean, I did not ask to rename the module DIRECTORY but to rename as you said e.g from newbb to forum.

Anyway thanks for the explanation as to how i can rename the directory , its useful info.

Quote:

sailjapan wrote:
Admin>Control Panel Home>modules> type the new name under the module you want to rename and click 'submit' at the bottom of the page, then click 'submit' on the confirmation page that appears.



I see everyother thing but not the SUBMIT. In the prvious versions its always there at the bottom but on 2.5 i just can't find it, can you?

7
sailjapan
Re: How can i rename a module

Quote:
i just can't find it, can you?


Yes. It's in the usual place for me...

8
bumpeboy
Re: How can i rename a module
  • 2010/3/2 23:22

  • bumpeboy

  • Friend of XOOPS

  • Posts: 170

  • Since: 2008/10/4


Quote:

sailjapan wrote:
Quote:
i just can't find it, can you?


Yes. It's in the usual place for me...


This is a serious case maybe am loosing my eye sight.
I have uploaded screen shots of version 2.42 which has it in the normal place and version 2.5.0 Alpha which i dont seem to find.
Can you give me a screen shot of where it is please.

9
sailjapan
Re: How can i rename a module

my install of 2.5 shows the button in exactly the same place as your screenshot of 2.4.2... weird.

10
bumpeboy
Re: How can i rename a module
  • 2010/3/3 21:06

  • bumpeboy

  • Friend of XOOPS

  • Posts: 170

  • Since: 2008/10/4


Quote:

sailjapan wrote:
my install of 2.5 shows the button in exactly the same place as your screenshot of 2.4.2... weird.


Does anyone else has this problem?

Login

Who's Online

56 user(s) are online (26 user(s) are browsing Support Forums)


Members: 0


Guests: 56


more...

Donat-O-Meter

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

Latest GitHub Commits