how to rehook a moved plugin ?

stickmenz

New Member
Hello,

I recently decided to redo the design of my website (www.theminelist.com) and I've been moving few things around.

I've moved the wrapper containing one of our custom plugins inside another wrapper page which I created and that seems to have broke the link with the CMS.

Instead of displaying the plugin, it shows this:


Which file(s) do I need to edit to make my new wrapper page be recognized by the CMS and hook into it ?

Thanks,

Regards.
 

Mark

Administrator
Staff member
Sorry I really dont understand what you have done, you should be making a child theme and editing the wrapper in your child folder. What your screenshot shows is that you are not loading your page through Visiolist templates at all.
 

stickmenz

New Member
Ok I understand what I've done wrong.

Is it possible to add a new page to a skin ? Or I need to use only the current ones ?

Thanks again
 

pratchet

Member
Is there a way to make a Custom_Page.HTML, but not recorded in the database? Еxample as stats page, but other content.
 

daannet

Member
Make a new sources file, add the source in the index.php if you want you can add a skin .html file

Your Sources file yourcustomsourcefilename.php
PHP:
 <?php
//===========================================================================\\
// VISIOLIST is a proud derivative work of Aardvark Topsites                \\
// Copyright (c) 2000-2009 Jeremy Scheff.  All rights reserved.              \\
//---------------------------------------------------------------------------\\
// http://www.aardvarktopsitesphp.com/                http://www.avatic.com/ \\
//---------------------------------------------------------------------------\\
// This program is free software; you can redistribute it and/or modify it  \\
// under the terms of the GNU General Public License as published by the    \\
// Free Software Foundation; either version 2 of the License, or (at your    \\
// option) any later version.                                                \\
//                                                                          \\
// This program is distributed in the hope that it will be useful, but      \\
// WITHOUT ANY WARRANTY; without even the implied warranty of                \\
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General \\
// Public License for more details.                                          \\
//===========================================================================\\
 
if (!defined('VISIOLIST')) {
  die("This file cannot be accessed directly.");
}
 
class yourcustomsourcefilename extends base {
  function yourcustomsourcefilename() {
    global $CONF, $DB, $FORM, $TMPL;
 
    $TMPL['header'] = 'Verdwaald';
    $TMPL['content'] = $this->do_skin('404');
  }
}
?>
Your index.php
PHP:
//You See:
$action = array(
 
//Add:
    'yourcustomsourcefilename' => 1,
 

pratchet

Member
I had some problems with clean URL, but finally solved thank you daannet :)
I have one more question, how plugin "ExitPage" makes its own page without putting 'forward' => 1 in index.php?
Оr is there a way not to edit index.php
 

Basti

Administrator
Staff member
Yes exactly, look at the files from the plugin. Thats how it is done ( Making a source file and the forward => 1 )
There is normally never a need to edit the core
 

Mark

Administrator
Staff member
Changing the core means you will need to re-apply all your edits after each upgrade. This is can be very time consuming, plugins are a MUCH better way to handle PHP edits, we can always add new hook locations if needed.

My advice to everyone is NEVER edit the core, you will regret it later down the road :) Plugins are great, easy, and meant to be used.


for example above we see some not so good advice above saying to edit index.php

PHP:
You See: $action  array(
Add:
'yourcustomsourcefilename'  => 1,
the correct way to handle this is with a plugin, call it action_array.php

PHP:
$action_yourcustomfilename = array(
    'yourcustomfilename' => 1
);
$action = array_merge($action, $action_yourcustomfilename);
now you dont need to edit index.php after every upgrade :) sooo simple, no reason to hack core files
 

Mark

Administrator
Staff member
and the next one will take you 2 minutes :) well worth the investment of learning I would say.
 
Top