| 
Welcome, Guest

UHP-CB automatic page approval
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: UHP-CB automatic page approval

UHP-CB automatic page approval 6 years ago #5060

  • Posts:
  • Karma:
Ok, so I'm trying to insert the database statement that runs when you "add all users" (allow all users to use their "my homepage") in UHP's backend, into the registration of CB... Can someone help me do this please? I believe the code below is what the 'addallusers' function runs... Can someone help me put this into a self-running function when someone registers an/or after verification? I'm thinking this should be pretty easy, I don't know what I'm doing with mysql statements though... thanks!

function Ffd7a4b05($option)
{
global $database, $my, $mosConfig_absolute_path, $mosConfig_live_site;
require_once("components/com_uhp/functions.php"«»);
require_once("components/com_uhp/uhp_config.php"«»);
$lists = array();
$where = array();
 
 
$where[] = "u.id is NULL ";
 
$database -> setQuery("SELECT h.* FROM #__users as h"
. "\nLEFT JOIN #__uhp as u ON u.user_id = h.id"
. (count($where) ? "\nWHERE " . implode(' AND ', $where) : ""«»)
);
if (!($users = $database -> loadObjectList())) {
mosRedirect("index2.php?option=$option", 'Access granted to all users.');
}

Re:UHP-CB automatic page approval 6 years ago #5080

  • Posts:
  • Karma:
I'm not sure either...but I can tell you that based on the code snippet above you are not inserting anything into the database. Just reading data out of a table.
JoomlaJoe *The developer formally known as MamboJoe*
CB Core Team

Re:UHP-CB automatic page approval 6 years ago #5091

  • Posts:
  • Karma:
ok, well that's not good... thanks for the reply though... I thought that "JOIN" might have been something like copy... guess not...

I think this would be a great option if people wanted to hack a core file... (at least until a version comes out with automatic member approval)... Maybe someone can find the database statement necessary and let us all know about it, it would be very much appreciated... thanks again

Re:UHP-CB automatic page approval 6 years ago #5183

  • Posts:
  • Karma:
ahh... I believe this is the code necessary to add users...
I'm not sure how I would implement this into the registration, any takes?

<?php
 
global $database, $my, $mosConfig_absolute_path, $mosConfig_live_site;
 
require_once("/administrator/components/com_uhp/functions.php"«»);
 
require_once("/administrator/components/com_uhp/uhp_config.php"«»);
 
$lists = array();
 
$where = array();
 
 
 
 
 
$where[] = "u.id is NULL ";
 
 
 
$database -> setQuery("SELECT h.* FROM #__users as h"
 
. "\nLEFT JOIN #__uhp as u ON u.user_id = h.id"
 
. (count($where) ? "\nWHERE " . implode(' AND ', $where) : ""«»)
 
);
 
if (!($users = $database -> loadObjectList())) {
 
mosRedirect("index2.php?option=$option", 'Access granted to all users.');
 
}
 
for ( $i = 0, $n = count( $users ); $i < $n; $i++ )
 
{
 
$userrow = &$users[$i];
 
 
 
$row = new mosuhp($database);
 
$row->user_id = $userrow->id;
 
$row->nick = $userrow->username;
 
$row->email = $userrow->email;
 
$row->website = "";
 
$row -> published = 0;
 
$row -> shownick = 0;
 
$row -> showemail = 0;
 
$row -> showwebsite = 0;
 
$row -> mypage = C9da9cc42;
 
$row -> _tbl_key = "id";
 
if (!$row -> check()){
 
echo "<script> alert('" . $row -> getError() . "'); window.history.go(-1); </script>\n";
 
exit();
 
}
 
 
 
if (!$row -> store()){
 
echo "<script> alert('" . $row -> getError() . "'); window.history.go(-1); </script>\n";
 
exit();
 
}
 
$row -> checkin();
 
}
 
mosRedirect("index2.php?option=$option","All users granted access"«»);
 
}
 
?>
 
 
 


Post edited by: chaking, at: 2006/02/05 10:42

Re:UHP-CB automatic page approval 6 years ago #5550

  • Posts:
  • Karma:
The file I had previously posted was not doing it... I'll keep trying...

Post edited by: chaking, at: 2006/02/05 10:45

Re:UHP-CB automatic page approval 6 years ago #5858

  • Posts:
  • Karma:
Our new release of the User Home Pages will solve the problem that you are having.

NOTE: People who obfuscate their code should be shot

I have the function for your cron script temporarily so when i find it i'll pass it on
Director/Solutions Architect of Australian Quality Solutions Group (www.aqsg.com.au)
Founder of josCommunity (www.joscommunity.com)
Founder of CCHSStudent (www.cchsstudent.com)
Community Builder 3rd Party Developer
PAXXGallery Developer
  • Page:
  • 1
  • 2
Time to create page: 1.02 seconds