Reputation: 521
I have an array of information of places and I wanna use them to create multiple pages in a phpfox site.
First I tried to manually insert data in phpfox database (in tables of phpfox_pages and phpfox_pages_text).
The page is shown up in the site but when opening it's link, the site says:
The page you are looking for cannot be found.
Do you know what other tables should I manipulate to make it work? Or do you know any plugin for phpfox to do the same?
Thanks,
Solved ( With @Purefan Guide):
"Pages" also has a user
If you take a look at phpfox_user
table, you'll found out how to fetch new records on that. But there are two ambiguous fields in that table ( password
& password_salt
). You can use this script to create values for the fields:
<?php
function generateRandomString()
{
$length = 164;
$characters = '-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
$sSalt = '';
for ($i = 0; $i < 3; $i++)
{
$sSalt .= chr(rand(33, 91));
}
$sPossible = generateRandomString();
$sPassword = '';
$i = 0;
while ($i < 10)
{
$sPassword .= substr($sPossible, mt_rand(0, strlen($sPossible)-1), 1);
$i++;
}
$password_Salt_Field = $sSalt;
$password_Field = md5(md5($sPassword) . md5($sSalt));
Upvotes: 0
Views: 1545
Reputation: 1506
Phpfox has 2 very similar modules: "Pages" and "Page", you create "Pages" if you want people to "like" them, post in them, add photos... a "Page" is static so I think this is what you want, in that case I would add to phpfox_page
and phpfox_page_text
Edit: Ok then you are probably forgetting to insert into phpfox_user
, a "Pages" also has a user, the following should shed some light:
$iUserId = $this->database()->insert(Phpfox::getT('user'), array(
'profile_page_id' => $iId,
'user_group_id' => NORMAL_USER_ID,
'view_id' => '7',
'full_name' => $this->preParse()->clean($aVals['title']),
'joined' => PHPFOX_TIME,
'password' => Phpfox::getLib('hash')->setHash($sPassword, $sSalt),
'password_salt' => $sSalt
)
);
Look in the file /module/pages/include/service/process.class.add around line 338 (depending on your version).
Upvotes: 1