News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Custom Pages

Started by Robbo_, February 27, 2009, 09:59:39 AM

Previous topic - Next topic

CowboyLogic

Error when installing Customer Pages on 2.0 RTC1-1

This is where you create, edit and remove custom pages. It is all fairly straight forward. The only thing to keep in mind is that the page ID needs to be unique. Support and feedback here.

An Error Has Occurred!
Wrong value type sent to the database. Array of integers expected. (id) 

This was the latest .12 release... any ideas?

Robbo_

Quote from: dav12 on June 07, 2009, 09:50:25 PM
Quote from: Robbo_ on June 07, 2009, 10:43:09 AM
You want it so that when someone searches your forums it also searches the custom pages content right?
I might add that depending on how hard it will be since I have never looked at the SMF search source files.

Yes but preferably, one that searches only select custom pages per setting/configuration.
You mean like using the browsers search function?

Quote from: CowboyLogic on June 08, 2009, 12:34:42 AM
Error when installing Customer Pages on 2.0 RTC1-1

This is where you create, edit and remove custom pages. It is all fairly straight forward. The only thing to keep in mind is that the page ID needs to be unique. Support and feedback here.

An Error Has Occurred!
Wrong value type sent to the database. Array of integers expected. (id)  

This was the latest .12 release... any ideas?
I think I have found the problem. Go into Sources/ManagePages.php, line 153.
Replace the code before 'default:' and 'break;' with the following and see if it fixes your problem.


                // Empty perms
                $perms = '';

                // Explode the groups.
            $groups = explode(',', $row['page_perms']);

            // Now query all the groups used.
            if (!empty($groups))
                {
                    $result = $smcFunc['db_query']('', '
                   SELECT group_name
                   FROM {db_prefix}membergroups
                   WHERE id_group IN ({array_int:id})
                   ORDER BY id_group ASC ' ,
                   array(
                      'id' => $groups,
                   )
                );

                // Loop through and make the $perms value.
                while($row2 = $smcFunc['db_fetch_assoc']($result))
                   $perms .= $row2['group_name'] . ', ';

                // I am free!
                $smcFunc['db_free_result']($result);

                // Remove the last comma.
                $perms = substr($perms,0,strlen($perms)-2);
                }
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

cybergoblin

Does some one have the empty database tables for this mod, my install keeps getting database creation errors see below.

Database Error
Table 'tradejo1_smf.pages' doesn't exist
File: /home/tradejo1/public_html/Sources/ManagePages.php
Line: 133

Robbo_

Quote from: cybergoblin on June 08, 2009, 06:36:46 AM
Does some one have the empty database tables for this mod, my install keeps getting database creation errors see below.

Database Error
Table 'tradejo1_smf.pages' doesn't exist
File: /home/tradejo1/public_html/Sources/ManagePages.php
Line: 133

I have no idea why it isn't creating your tables. My compat.php file should fix the errors in RC1 that cause the problems :/ Maybe something got changed in RC1-1 that I haven't noticed.

What database are you using, SMF versiona and what is the error you get on install when it fails to make the tables.

Here is the sql to make the tables...

CREATE TABLE `{prefix_here}pages` (
  `id_page` varchar(255) NOT NULL,
  `page_title` varchar(255) NOT NULL,
  `page_body` text NOT NULL,
  `page_perms` varchar(255) NOT NULL,
  `page_views` bigint(11) NOT NULL default '0',
  `page_format` tinyint(1) NOT NULL default '0',
  `page_time` int(10) NOT NULL default '0',
  `page_settings` varchar(10) NOT NULL default '1:1:0',
  `page_class` varchar(255) NOT NULL default 'tborder',
  `page_styles` varchar(255) NOT NULL default '',
  `title_class` varchar(255) NOT NULL default 'titlebg',
  `title_styles` varchar(255) NOT NULL,
  `body_class` varchar(255) NOT NULL default 'windowbg',
  `body_styles` varchar(255) NOT NULL,
  PRIMARY KEY  (`id_page`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `{prefix_here}log_cpfloodcontrol` (
  `ip` char(16) NOT NULL,
  `log_time` int(10) NOT NULL,
  `id_page` varchar(255) NOT NULL,
  PRIMARY KEY  (`ip`,`log_time`,`id_page`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


I'll get a new version out as soon as possible to fix these new issues.
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

Legendary Guardian

I receive this error whenever I try to use anything with this modification.

QuoteTable 'ilmatar.smf_pages' doesn't exist
File: /home/magmod/magistia.net/ilmatar/Sources/Subs-CustomPages.php
Line: 56

This is my first time using Simple Machines, and it's version 2.0 of SM, so...I don't know what else to tell you besides that. Any idea what's wrong and why it's not working?

allisondk

I´ve tried to install this on a test forum i´ve got running 1.1.9 with simple portal and just tried it at the "working forum" running 2.0RC1 both places i got this error:
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Any idea why?

CowboyLogic

Quote from: Robbo_ on June 08, 2009, 01:10:14 AM
Quote from: dav12 on June 07, 2009, 09:50:25 PM
Quote from: Robbo_ on June 07, 2009, 10:43:09 AM
You want it so that when someone searches your forums it also searches the custom pages content right?
I might add that depending on how hard it will be since I have never looked at the SMF search source files.

Yes but preferably, one that searches only select custom pages per setting/configuration.
You mean like using the browsers search function?

Quote from: CowboyLogic on June 08, 2009, 12:34:42 AM
Error when installing Customer Pages on 2.0 RTC1-1

This is where you create, edit and remove custom pages. It is all fairly straight forward. The only thing to keep in mind is that the page ID needs to be unique. Support and feedback here.

An Error Has Occurred!
Wrong value type sent to the database. Array of integers expected. (id) 

This was the latest .12 release... any ideas?
I think I have found the problem. Go into Sources/ManagePages.php, line 153.
Replace the code before 'default:' and 'break;' with the following and see if it fixes your problem.


                // Empty perms
                $perms = '';

                // Explode the groups.
            $groups = explode(',', $row['page_perms']);

            // Now query all the groups used.
            if (!empty($groups))
                {
                    $result = $smcFunc['db_query']('', '
                   SELECT group_name
                   FROM {db_prefix}membergroups
                   WHERE id_group IN ({array_int:id})
                   ORDER BY id_group ASC ' ,
                   array(
                      'id' => $groups,
                   )
                );

                // Loop through and make the $perms value.
                while($row2 = $smcFunc['db_fetch_assoc']($result))
                   $perms .= $row2['group_name'] . ', ';

                // I am free!
                $smcFunc['db_free_result']($result);

                // Remove the last comma.
                $perms = substr($perms,0,strlen($perms)-2);
                }


I need a little more information please.

Do I replace
//Now loop through all the rows on down to "Break;", or
//Work out the perms value to use
      switch($row['page_perms']) down to "Break;"?

Robbo_

Sorry made a typo with that. I mean to say "Replace the code in-between 'default:' and 'break;' with the following and see if it fixes your problem."

To everyone else I will get to making a new version as soon as I have time which will hopefully fix all your problems.
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

allisondk

1.0.1.2 and just updated to rc1-1
Its the modification on index.php that fails

CowboyLogic

No love yet I'm afraid.
Here is what my ManagePages.php looks like now. See attachment

Robbo_

Quote from: CowboyLogic on June 11, 2009, 09:14:45 PM
No love yet I'm afraid.
Here is what my ManagePages.php looks like now. See attachment
It must be a bug to do with what other people are having problems with because what I told you to change looks fine.

I'll try get a patch out this weekend.
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

allisondk

OK, just tried again and it works like a charm, alongside simpleportal this is cool.

I´m trying to get a lightbox to work on a custom page, any idea if that is possible (like www.ilms-erl.com/teams.html)

dav12

Robo, I was talking about adding a search engine & box (that will be able to search through the contents of the database, smf_pages).

Is that possible or doable?

Robbo_

I don't know if I will ever get a search feature added. I don't see much use for it and I barely have time to maintain the mod.
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

MMcGrad2

Give it the ability to create new tabs in the forum which display the unique page id.

dav12

Quote from: Robbo_ on June 13, 2009, 08:40:47 AM
I don't know if I will ever get a search feature added. I don't see much use for it and I barely have time to maintain the mod.

I really really really do need 1. If you can quickly make one...please?

pkrpkr

This is a really useful mod - thanks!
How do I donate?

CowboyLogic

Just checking in Robbo, any ETA on that patch?

Robbo_

I'll try patch it this week. Just need to get some more work done for a client before I look into any of my stuff.

You can donate through paypal to [email protected]. Thanks for any donations! :)
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

CowboyLogic

Awesome. Thanks for the update.

Advertisement: