News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom blocks

Started by davidhs, June 28, 2013, 03:02:05 PM

Previous topic - Next topic

MaccabeeY

#41
davidhs,

Awesome mod!  Good work.

I think I have found a bug.  In Admin.php there are two lines:

       
  •   array('cbSettingsShow', 'area=modsettings;sa=cb'),
  •   array('cbSettingsEdit', 'area=modsettings;sa=cbedit'),
They break the built-in Admin "Quick Search" function.  With those lines in Admin.php, all searches go to the Custom Block page.  With those lines commented out, the "Quick Search" works as usual.
I have looked into the cause to see if I could uncover it, but as yet have had no joy, being new to php coding and SMF in general and as the search routines are rather intricate/cryptic.
I am guessing your experience will find the cause in no time.
Look forward to your thoughts,
Edward

P.S.  Sorry forgot to some helpful details:   SMF v2.0.6; same effect on themes, CORE and CURVE both.

davidhs

Quote from: MaccabeeY on December 19, 2013, 02:24:43 PM
davidhs,

Awesome mod!  Good work.

I think I have found a bug.  In Admin.php there are two lines:

       
  •   array('cbSettingsShow', 'area=modsettings;sa=cb'),
  •   array('cbSettingsEdit', 'area=modsettings;sa=cbedit'),
They break the built-in Admin "Quick Search" function.  With those lines in Admin.php, all searches go to the Custom Block page.  With those lines commented out, the "Quick Search" works as usual.
I have looked into the cause to see if I could uncover it, but as yet have had no joy, being new to php coding and SMF in general and as the search routines are rather intricate/cryptic.
I am guessing your experience will find the cause in no time.
Look forward to your thoughts,
Edward

P.S.  Sorry forgot to some helpful details:   SMF v2.0.6; same effect on themes, CORE and CURVE both.
I test on two forums with this MOD and quick search works. I do not know why on your forum do not work :(

On your forum, Work with both lines commented? Or only one?

Somebody has same problem?

MaccabeeY

Quote from: davidhs on December 19, 2013, 05:25:55 PM
I test on two forums with this MOD and quick search works. I do not know why on your forum do not work :(

On your forum, Work with both lines commented? Or only one?

Somebody has same problem?
Thanks for the fast response.
Here are my steps:

       
  • Install fresh, new SMF installation v2.0.6 (new database, new folder, everything)
  • login
  • Admin Center "Quick Search" <some text>
  • all is good
  • install CB mod
  • Admin Center "Quick Search" <some text>
  • Now search returns to the "Add block in the forum header" page
I am able to repeat, no problem.  If you would, like, I can demonstrate via Skype...
I am happy to help out anyway you need
Edward
(Still love the creativity of your mods)

Arantor

Now search for something that isn't in your mod.

davidhs

Quote from: MaccabeeY on December 19, 2013, 06:47:58 PM
Admin Center "Quick Search" <some text>
I suppouse this is the search box at right of forum header...


I will test with a new install.

davidhs

I install a new SMF 2.0.6 forum.
1. I search "SMF" and return a list of post with welcome smf post.
2. I install Custom blocks, search "SMF" and return a list of post with welcome smf post.
3. I create blocks above, in and below forum header, search "SMF" and return a list of post with welcome smf post.

All works.

Can you tell me (here or by PM) your forum url?

Arantor

No, not that search box, but the one inside the admin panel.

davidhs

Quote from: Arantor Beeblebrox the First on December 20, 2013, 07:53:55 AM
No, not that search box, but the one inside the admin panel.
I see now! Thanks, I have never used this. And does not work. :(

I will see why...

davidhs

I see the reason. I will update all my MODs with this bug, soon.

MaccabeeY

So glad you found the bug.  I dug around for quite a bit, but I'm still very new to SMF.  Would you share what was the cause and effect?
Thx,
Edward

davidhs

New version:
2.2     2013-12-20
------------------
! SMF 2.0.x: Functions of administration area must return settings variables for the Quick Search of the Administration Center.
+ SMF 2.0.x: The Quick Search of the Administration Center look for in settings variables of MOD.
+ Variable in content of the block to insert URL to forum folder.

davidhs

Quote from: MaccabeeY on December 20, 2013, 05:01:24 PM
Would you share what was the cause and effect?
My settings functions must return something on SMF 2.0.x.

Before (bug)
function cbSettingsEdit()
{
...
}
function cbSettingsShow()
{
...
}


Now (correct)
function cbSettingsEdit($return_config = false)
{
...
if ($return_config)
return array(); // Is not necesary return anything here.
...
}
function cbSettingsShow($return_config = false)
{
...
if ($return_config)
{
$config_vars = array();
// Fill $config_vars
return $config_vars;
}
...
}

MaccabeeY

My settings functions must return something on SMF 2.0.x.

Now (correct)
   ...
function cbSettingsShow($return_config = false)
{
   ...
   if ($return_config)
   {
==>      $config_vars = array();
      // Fill $config_vars
      return $config_vars;
   }
   ...
}



Thank you for that!!   I looking to test myself.  And it turns out my eyes still "got it".  The $configs_vars was the tree I was barking up during my research into your mod, I just had not pieced together HOW the mods populated the Search.

Much thanks

davidhs

New version:
2.3     2014-01-25
------------------
+ Upgrade code to the configuration variables from versions 2.1-2.2 to 2.3.
* Permissions for local moderator and global moderator instead of moderator.
+ Checkbox to select all users of permissions.
+ SMF compatibility: 2.0.7.

kamili34

Hi

Get error in     ./Themes/default/index.template.php
                       ./Themes/Aqua/index.template.php

Can't find full phrases to edit. What should I do?

davidhs

Quote from: kamili34 on February 17, 2014, 05:09:51 PM
Hi

Get error in     ./Themes/default/index.template.php
                       ./Themes/Aqua/index.template.php

Can't find full phrases to edit. What should I do?
Where get this error? Have you images? What is your SMF version?

kamili34

My smf version is 2.0.7. got error like in attachments screen.

davidhs

Now I see the problem!

If your theme Aqua made changes in index.template.php is normal that issues error. This mod only install without error in default theme and similars.

Error in default/index.template.php could occur because another mod modify this file in some lines used by my mod

You will most probably not be able install my mod on your forum or you have to install it manually.

If you attach here your default/index.template.php file I can say with lines was change.

kamili34


Advertisement: