|
|
| Author |
Message |
Seth Sandrino
New User
Joined: 12 Jan 2010
Posts: 22
|
Posted: January 17th 2010, 12:49 pm Post subject: Making a Mod Similar to Jr. Admin |
|
|
Because the Jr. Admin mod does not work on my version of phpbb (2.0.23) and the fact that I was told there was security issues with the mod I am looking to create something similar. My idea is this:
Use usergroups to allow access to the ACP.
Hide bits of the panel with checking user_level so only admin can see what you want more secure.
Allow access to the parts you want the usergroups to have access to in the same way that usergroups are allowed to see hidden forums.
The only problem is I am not a programmer and have no idea how to get this started. Would anyone care to help me out with this? |
|
| Back to top |
|
 |
Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.
|
Posted: January 17th 2010, 2:44 pm Post subject: |
|
|
Hello Mr. Sandrino,
Thanks for posting. In order to write a hack, you are going to need some level of programming knowledge. But, maybe some other can recommend some PHP tutorials, guides, books, etc. for you to check out and read. But, it will take time.
Thanks,
Patrick _________________ Patrick O'Keefe - phpBBHacks.com Administrator - Feedback? Questions? Please Contact Me!
User Guidelines - Featured phpBB - Featured Author - phpBBHacks.com Awards - Supported Sites - About Us
Author, Managing Online Forums - A Practical Guide to Community Management
phpBB 3 Tutorials: Add Hacks | Clear Your Cache | Fix Missing Images | phpBB 3 Permissions Guide |
|
| Back to top |
|
 |
Seth Sandrino
New User
Joined: 12 Jan 2010
Posts: 22
|
Posted: January 18th 2010, 5:30 pm Post subject: |
|
|
thanks for the reply Patrick. I went ahead and found my own tutorials so I could get started although, sadly I've already ran into my first road block.
| Code:
|
$user_groups_game_mod_table = mysql_query("SELECT user_id FROM phpbb_user_group WHERE group_id=6");
while($row = mysql_fetch_array($user_groups_game_mod_table))
{
echo $row['group_id'] . " " . $row['user_id'];
echo "<br/>";
}
$game_mod_array =array($row);
if (!$game_mod_array)
{
die('Assigning $game_mod_array failed ' . mysql_error());
}
else
echo "Game Mod Array Below:";
echo $game_mod_array;
echo "<br>";
$user_id_my_test = $userdata['user_id'];
if (!$user_id_my_test)
{
die('$user_id_my_test asign failed ' . mysql_error());
}
echo $user_id_my_test;
if (in_array($user_id_my_test,$game_mod_array))
{
$game_mod_check = '1';
}
else
{
$game_mod_check = '0';
}
echo "<br>";
echo $game_mod_check;
//end my jr. admin attempt //
|
I cannot seem to get the "if (in_array($user_id_my_test,$game_mod_array)) " to work properly. At first I had the array simply as $row but it said that it was the wrong type (I thought this meant not an array so I tried to make it into an array ($game_mod_array) but it is isn't functioning properly.
(when a user logs in (me) it isn't setting $game_mod_check properly. My user_id should be in the array. However it sets $game_mod_check to 0. So I think the check may be working but the array is not being made properly.)
* I only have the echos in there so I could see it working.
Thanks for any help or pointers you see fit in giving,
Seth Sandrino |
|
| Back to top |
|
 |
Seth Sandrino
New User
Joined: 12 Jan 2010
Posts: 22
|
Posted: January 22nd 2010, 5:22 pm Post subject: |
|
|
I am incredibly close. I got the array working but my in_array() doesn't seem to be functioning.
| Code:
|
$query = "SELECT user_id FROM phpbb_user_group WHERE group_id=6";
$result = mysql_query($query) or die(mysql_error());
//count the rows and fields
$totalRows = mysql_num_rows($result);
$totalFields = mysql_num_fields($result);
//start the loop
for ( $i = 0; $i < $totalRows; ++$i ) {
//make it 2 dim in case you change your order
$results[$i] = mysql_fetch_array($result);
//call data at will controlling the loop with the array
echo $results[your_row_id]['your_field_name']; }
//print the entire array to see what lives where
print_r($results);
$test_con = mysql_connect("localhost","crimhunt_Gregor","brocop4924");
if (!$test_con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("crimhunt_adrTest", $test_con);
//talk to the db
$query = "SELECT user_id FROM phpbb_user_group WHERE group_id=6";
$result = mysql_query($query) or die(mysql_error());
//count the rows and fields
$totalRows = mysql_num_rows($result);
$totalFields = mysql_num_fields($result);
//start the loop
for ( $i = 0; $i < $totalRows; ++$i ) {
//make it 2 dim in case you change your order
$results[$i] = mysql_fetch_array($result);
//call data at will controlling the loop with the array
echo $results[your_row_id]['your_field_name']; }
//print the entire array to see what lives where
print_r($results);
$user_id_my_test = $userdata['user_id'];
if (!$user_id_my_test)
{
die('$user_id_my_test asign failed ' . mysql_error());
}
echo $user_id_my_test;
if (in_array($user_id_my_test,$results))
{
$game_mod_check = '1';
}
else
{
$game_mod_check = '0';
}
|
here's the read out I'm getting:
Array ( [0] => Array ( [0] => 2 [user_id] => 2 ) [1] => Array ( [0] => 3 [user_id] => 3 ) ) Array ( [0] => Array ( [0] => 2 [user_id] => 2 ) [1] => Array ( [0] => 3 [user_id] => 3 ) )
3 (which would be the user id)
0 (which would be $game_mod_check)
as you can see the user id of 3 is in the array..
$game_mod_check is equal to 0 in cases I know it should be 1. Any ideas where I went wrong?
Thanks, |
|
| Back to top |
|
 |
ABDev
Not So New User
Joined: 21 Nov 2005
Posts: 39
Location: Lens / France
|
Posted: November 30th 2010, 4:59 pm Post subject: |
|
|
| I have fully revized "Jr Admin", if that can interest you. |
|
| Back to top |
|
 |
Dogs and Things
Well Known User
Joined: 11 Sep 2006
Posts: 189
|
Posted: December 1st 2010, 2:06 am Post subject: |
|
|
I am interested.  |
|
| Back to top |
|
 |
ABDev
Not So New User
Joined: 21 Nov 2005
Posts: 39
Location: Lens / France
|
Posted: December 1st 2010, 3:44 am Post subject: |
|
|
Ok, I prepare you that . |
|
| Back to top |
|
 |
Dogs and Things
Well Known User
Joined: 11 Sep 2006
Posts: 189
|
Posted: December 1st 2010, 5:47 am Post subject: |
|
|
| Tres bien! |
|
| Back to top |
|
 |
Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.
|
|
| Back to top |
|
 |
|