[ABD] phpBB Rivals (Clans, Ladders & Tournaments)

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Jackanape »

Thanks! I registered a clan, and took a look at some of the features--I will revisit in a day or so, to check it out again. Cheers!
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
Benely
Registered User
Posts: 137
Joined: Fri Dec 29, 2006 3:28 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Benely »

I nkow once againn this is very much off the topic of finding bugs etc. But I recently had to re-install my forum because well I messed soemthing up big style :P

What I'm trying to do is make it so when a clan is created it is automactically added to a ladder. At the moment I'm using this code which used to work:
//Select clan with Highest ID (Clan Just added)
$query = "SELECT MAX(clan_id) FROM phpbb_rivals_clans";
$result = mysql_query($query);
$row = mysql_fetch_array($result);

//Define var whcih has highest clan id
$clfanid = $row['MAX(clan_id)'];

//Add Clan to Clan Direcotry
mysql_query("INSERT INTO phpbb_rivals_clanladders (clan_id, ladder_id) VALUES ($clfanid, '2') ") or die(mysql_error());
Now I've reinstalled my forum, and tried to use this code I get this error..
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 23: mysql_query() [function.mysql-query]: Access denied for user 'benalec'@'localhost' (using password: NO)
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 23: mysql_query() [function.mysql-query]: A link to the server could not be established
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 24: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 30: mysql_query() [function.mysql-query]: Access denied for user 'benalec'@'localhost' (using password: NO)
[phpBB Debug] PHP Notice: in file /rivals/add_clan.php on line 30: mysql_query() [function.mysql-query]: A link to the server could not be established
Access denied for user 'benalec'@'localhost' (using password: NO)
:s
A.I. BOT
Registered User
Posts: 1848
Joined: Thu Apr 17, 2003 11:43 pm
Location: Newfoundland, Canada
Contact:

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by A.I. BOT »

After the query which adds the clan to the DB, use this:

Code: Select all

$last_id = $db->sql_insertid ( ); // I think thats what the function is called, sql_insertid?

//Add Clan to Clan Direcotry
$db->sql_query("INSERT INTO phpbb_rivals_clanladders (clan_id, ladder_id) VALUES ($last_id, '2') ");
Benely
Registered User
Posts: 137
Joined: Fri Dec 29, 2006 3:28 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Benely »

Fatal error: Call to undefined method dbal_mysqli::sql_insertid() in /home/benalec/public_html/rivals/add_clan.php on line 21
Don't think it is, I'll ahve a look aroudn see what it is
Benely
Registered User
Posts: 137
Joined: Fri Dec 29, 2006 3:28 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Benely »

Could I use this?
mysql_insert_id — Get the ID generated from the previous INSERT operation
A.I. BOT
Registered User
Posts: 1848
Joined: Thu Apr 17, 2003 11:43 pm
Location: Newfoundland, Canada
Contact:

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by A.I. BOT »

No

This should work....

Code: Select all

$last_id = $db->sql_nextid ( );

//Add Clan to Clan Direcotry
$db->sql_query("INSERT INTO phpbb_rivals_clanladders (clan_id, ladder_id) VALUES ($last_id, '2') ");
Benely
Registered User
Posts: 137
Joined: Fri Dec 29, 2006 3:28 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Benely »

Thank you very much :)

Your now my god :)
ecollins
Registered User
Posts: 35
Joined: Tue May 31, 2005 8:23 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by ecollins »

If I try to report a match in the AdminCP I get this:

Code: Select all

SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ps3)' at line 1 [1064]

SQL

SELECT * FROM phpbb3_rivals_ladders WHERE ladder_id = cod4 (ps3)

BACKTRACE


FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: rivals/classes/class_ladder.php
LINE: 61
CALL: dbal_mysql->sql_query()

FILE: rivals/classes/class_ladder.php
LINE: 25
CALL: ladder->data()

FILE: rivals/acp_reportmatch.php
LINE: 10
CALL: ladder->ladder()

FILE: rivals.php
LINE: 40
CALL: include('rivals/acp_reportmatch.php')

If I try ti report a match in the clanCP I get this:

Code: Select all

SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND clan_2id = ""' at line 1 [1064]

SQL

SELECT * FROM phpbb3_rivals_treports WHERE report_tournament = 3 AND clan_1id = AND clan_2id = ""

BACKTRACE


FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: rivals/ccp_tournaments.php
LINE: 30
CALL: dbal_mysql->sql_query()

FILE: rivals.php
LINE: 40
CALL: include('rivals/ccp_tournaments.php')
If I try to join a ladder I get this:

Code: Select all

SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ps3)' at line 1 [1064]

SQL

SELECT * FROM phpbb3_rivals_ladders WHERE ladder_id = cod4 (ps3)

BACKTRACE


FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: rivals/classes/class_ladder.php
LINE: 61
CALL: dbal_mysql->sql_query()

FILE: rivals/classes/class_ladder.php
LINE: 25
CALL: ladder->data()

FILE: rivals/ccp_ladders.php
LINE: 9
CALL: ladder->ladder()

FILE: rivals.php
LINE: 40
CALL: include('rivals/ccp_ladders.php')

As you can see i have only made 27ish posts on here in almost 4 years so i usually pretty good at figuring this stuff out But I have tried everyting to get rid of these errors.
A.I. BOT
Registered User
Posts: 1848
Joined: Thu Apr 17, 2003 11:43 pm
Location: Newfoundland, Canada
Contact:

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by A.I. BOT »

When your reporting these matches, are you selecting a ladder or sub-ladder, if your selecting ladder: this would be your problem ;)
ecollins
Registered User
Posts: 35
Joined: Tue May 31, 2005 8:23 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by ecollins »

ok this might be complicated or simple depending on how I ask the question I guess.

Everything looks great after i figured out what the errors was for, I am sure when you get done with this and get it release when you dont have things like subladders setup, it will return an error saying you dont have a subladder.

But for now my questions are these.

I run a clan website. It is for a single Clan. All my members are in the same clan. The tournament software looks great. But how difficult would it be to make the software so it just registers all members or users as being ready to just join a tournament.

Example I go in Admin panel, setup tournament for my members.
The ones that want to join the tournament just go up and click join or signup.

If you are busy with other parts of this software you dont have to answer this question as I know programming can be fustrating.
A.I. BOT
Registered User
Posts: 1848
Joined: Thu Apr 17, 2003 11:43 pm
Location: Newfoundland, Canada
Contact:

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by A.I. BOT »

Not sure I understand. You make a tournament... the clans that are ready go to the tournament page and click join/sign-up.

Thanks.
Benely
Registered User
Posts: 137
Joined: Fri Dec 29, 2006 3:28 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Benely »

Hello, I'm Benely, as if you didnt know that already, and AI BOT created a Current Clan field for me, so I thought I'd share it all with you. I made a little tweak to it AI so hope you dont mind.

Open Memberlist.php

Find:

Code: Select all

		$template->assign_vars(array(
			'POSTS_DAY'			=> sprintf($user->lang['POST_DAY'], $posts_per_day),
Add before:

Code: Select all

// Initilize the includes and variables needed.
define ( 'CLANMEMBERS_TABLE', $table_prefix . 'rivals_clanmembers' );
define ( 'CLANS_TABLE', $table_prefix . 'rivals_clans' );
define ( 'CLANLADDERS_TABLE', $table_prefix . 'rivals_clanladders' );
include ( $phpbb_root_path . 'rivals/classes/class_clan.' . $phpEx );
$clan   = new clan ( );

// Get the clans the user is apart of...
$sql8   = 'SELECT * FROM ' . CLANMEMBERS_TABLE . ' WHERE member_userid = ' . $member[ 'user_id' ] . ' AND member_status = 1';
$result8   = $db->sql_query ( $sql8 );

	while ( $row8 = $db->sql_fetchrow ( $result8 ) )
	{
	   // Now, provide a template loop to display the clans.
	   $template->assign_block_vars ( 'block_clans', array (
		  'U_CLANNAME' => append_sid ( 'rivals.php?action=clan_profile&clan_id=' . $row8[ 'member_clan' ] ),
		  'S_CLANNAME' => $clan->data ( 'clan_name', $row8[ 'member_clan' ] ) )
	   );
	}

// Get the clans the user leads or co-leads
$sql9   = 'SELECT * FROM ' . CLANS_TABLE . ' WHERE (clan_owner = ' . $member[ 'user_id' ] . ' OR clan_ownerb = ' . $member[ 'user_id' ] . ')';
$result9   = $db->sql_query ( $sql9 );

if ( $db->sql_affectedrows ( $result9 ) < 1 && $db->sql_affectedrows ( $result8 ) < 1 ) 
{
	$template->assign_block_vars ( 'block_noleadclans', array (
		'L_NOLEADCLANS' => 'Clanless',
		'L_INVITE' => 'Invite User',
		'U_INVITE' => append_sid ( 'rivals.php?action=clan_profile&clan_id=' . $member[ 'user_id' ] ),
	));
}
else
{
	while ( $row9 = $db->sql_fetchrow ( $result9 ) )
	{
	   // Now, provide a template loop to display the clans.
	   $template->assign_block_vars ( 'block_leadclans', array (
		  'U_CLANNAME' => append_sid ( 'rivals.php?action=clan_profile&clan_id=' . $row9[ 'clan_id' ] ),
		  'S_CLANNAME' => $row9[ 'clan_name' ] )
	   );
	}
}
Open Styles/YourStyleName/Memberlist_View.html

And add in (in an apporiate place):

Code: Select all

		<!-- BEGIN block_clans -->
		<a href="{block_clans.U_CLANNAME}">{block_clans.S_CLANNAME}</a><br />
		<!-- END block_clans -->
<!-- BEGIN block_leadclans -->
<a href="{block_leadclans.U_CLANNAME}">{block_leadclans.S_CLANNAME}</a><br />
<!-- END block_leadclans -->

<!-- BEGIN block_noleadclans -->
{block_noleadclans.L_NOLEADCLANS}
<!-- END block_noleadclans -->
Oby
Registered User
Posts: 5
Joined: Sun Mar 30, 2008 3:38 pm

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by Oby »

When clicking "Manage ladders" in the Clan CP:

Code: Select all

SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [1064]

SQL

SELECT * FROM phpbb_rivals_ladders WHERE ladder_id =

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 143
CALL: dbal->sql_error()

FILE: rivals/ccp_ladders.php
LINE: 82
CALL: dbal_mysqli->sql_query()

FILE: rivals.php
LINE: 40
CALL: include('rivals/ccp_ladders.php')
EDIT: This only happens when managing the first clan that I create in Rivals (ID=1). Another test clan (ID=2) works as a charm.
TexasBartender
Registered User
Posts: 46
Joined: Fri Feb 08, 2008 6:58 am

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by TexasBartender »

How do I install this there is no install file at at least i cant find it
A.I. BOT
Registered User
Posts: 1848
Joined: Thu Apr 17, 2003 11:43 pm
Location: Newfoundland, Canada
Contact:

Re: [BETA] phpBB Rivals (Clans, Ladders & Tournaments)

Post by A.I. BOT »

docs/INSTALL
Locked

Return to “[3.0.x] Abandoned MODs”