Welcome to Geeklog, Anonymous Tuesday, April 23 2024 @ 08:31 pm EDT

Geeklog Forums

static pages


Status: offline

dps

Forum User
Newbie
Registered: 10/31/06
Posts: 6
how can i clone the staticpages plugin?

my geeklog site uses static pages for 3 main purposes. as my site is growing i'd like to seperate these 3 categories of static pages into their own. to do so i think the best way is to duplicate the plugin alltogether and install 2 seperate static pages plugins, one named 'mailer' and the other named 'venue'.

how do i go about doing this??

-Christian Banging your head
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You would have to find all places in the plugin's code where it refers to the table name, the path, and the URL. Shouldn't be too hard, actually, if you search for $_TABLES['staticpage'], $_CONF['path'], $_CONF['site_url'], and $_CONF['site_admin_url']. Oh, and the permissions ('staticpage.edit', etc. plus the 'Static Page Admin' group name).

But you have to be very careful not to miss any occurences or you may end up with weird errors when one of your cloned plugins writes into the static pages plugin's tables ...

bye, Dirk
 Quote

Status: offline

dps

Forum User
Newbie
Registered: 10/31/06
Posts: 6
in the sql/install of staticpages the table gets created... if i creat a table 'staticpage_venues' (instead of 'staticpage') can i leave the following as is or do i need to edit this as well?


CREATE TABLE {$_TABLES['staticpage_venues']} (
sp_id varchar(40) NOT NULL default '',
sp_uid mediumint(Cool NOT NULL default '1',
sp_title varchar(12Cool NOT NULL default '',
sp_content text NOT NULL,
sp_hits mediumint(Cool unsigned NOT NULL default '0',
sp_date datetime NOT NULL default '0000-00-00 00:00:00',
sp_format varchar(20) NOT NULL default '',
sp_onmenu tinyint(1) unsigned NOT NULL default '0',
sp_label varchar(64) default NULL,
owner_id mediumint(Cool unsigned NOT NULL default '1',
group_id mediumint(Cool unsigned NOT NULL default '1',
perm_owner tinyint(1) unsigned NOT NULL default '3',
perm_group tinyint(1) unsigned NOT NULL default '2',
perm_members tinyint(1) unsigned NOT NULL default '2',
perm_anon tinyint(1) unsigned NOT NULL default '2',
sp_centerblock tinyint(1) unsigned NOT NULL default '0',
sp_tid varchar(20) NOT NULL default 'none',
sp_where tinyint(1) unsigned NOT NULL default '1',
sp_php tinyint(1) unsigned NOT NULL default '0',
sp_nf tinyint(1) unsigned default '0',
sp_inblock tinyint(1) unsigned default '1',
PRIMARY KEY (sp_id),
KEY staticpage_sp_uid (sp_uid),
KEY staticpage_sp_date (sp_date),
KEY staticpage_sp_onmenu (sp_onmenu),
KEY staticpage_sp_centerblock (sp_centerblock),
KEY staticpage_sp_tid (sp_tid),
KEY staticpage_sp_where (sp_where)
) TYPE=MyISAM


thanks in advance
-christian Banging your head
 Quote

Status: offline

dps

Forum User
Newbie
Registered: 10/31/06
Posts: 6
Quote by Dirk: You would have to find all places in the plugin's code where it refers to the table name, the path, and the URL. Shouldn't be too hard, actually, if you search for $_TABLES['staticpage'], $_CONF['path'], $_CONF['site_url'], and $_CONF['site_admin_url']. Oh, and the permissions ('staticpage.edit', etc. plus the 'Static Page Admin' group name).

But you have to be very careful not to miss any occurences or you may end up with weird errors when one of your cloned plugins writes into the static pages plugin's tables ...

bye, Dirk


how about i pay you to make a .rar file with a few staticpages clones... 1 named 'venues' 1 named 'mailer' and 1 named 'artist'. would you do this and for how much?

-Christian Doh! - that was a mistake
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Quote by Dirk: You would have to find all places in the plugin's code where it refers to the table name, the path, and the URL. Shouldn't be too hard, actually, if you search for $_TABLES['staticpage'], $_CONF['path'], $_CONF['site_url'], and $_CONF['site_admin_url']. Oh, and the permissions ('staticpage.edit', etc. plus the 'Static Page Admin' group name).
And don't forget to rename the $LANG_STATIC and $_SP_CONF variables and update all the language files (or at least all the language files you are going to use). Oh, and you have to rename all of the plugin_???_staticpages functions and check their contents for stray 'staticpages' text.

Not a quick fix. The $_CONF path and url vars are the real killers since they don't lend themselves to simple search and replace. Perhaps someone should modify the existing static page plugin to create $_SP_CONF['path_plus'], $_SP_CONF['site_url_plus'] and $_SP_CONF['site_admin_url_plus'] variables to replace the $_CONF vars which would make cloning the sp plugin a big search and replace action (plus language file updates).
 Quote

All times are EDT. The time is now 08:31 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content