Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

UHP-CB automatic page approval

  • chaking
  • chaking
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
18 years 10 months ago #5060 by chaking
UHP-CB automatic page approval was created by chaking
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!

[code:1]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.');
}[/code:1]

Please Log in or Create an account to join the conversation.

  • JoomlaJoe
  • JoomlaJoe
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 14
18 years 10 months ago #5080 by JoomlaJoe
Replied by JoomlaJoe on topic Re:UHP-CB automatic page approval
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

Please Log in or Create an account to join the conversation.

  • chaking
  • chaking
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
18 years 10 months ago #5091 by chaking
Replied by chaking on topic Re:UHP-CB automatic page approval
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

Please Log in or Create an account to join the conversation.

  • chaking
  • chaking
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
18 years 10 months ago #5183 by chaking
Replied by chaking on topic Re:UHP-CB automatic page approval
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?

[code:1]<?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"«»);

}

?>


[/code:1]

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

Please Log in or Create an account to join the conversation.

  • chaking
  • chaking
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
18 years 10 months ago #5550 by chaking
Replied by chaking on topic Re:UHP-CB automatic page approval
The file I had previously posted was not doing it... I'll keep trying...

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

Please Log in or Create an account to join the conversation.

  • aqsg
  • aqsg
  • OFFLINE
  • Posts: 29
  • Thanks: 0
  • Karma: 3
18 years 10 months ago #5858 by aqsg
Replied by aqsg on topic Re:UHP-CB automatic page approval
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 :P

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

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum