Help with Friend/Foe page

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Help with Friend/Foe page

Postby 2bit » 04 Aug 2008, 03:38

I was going to write a basic mod to practice. For my first mod i wanted to choose something simple but i hit a brick wall! All i wanted to do is create a page that lists your friends and foes. When i looked at the zebra table it had user id, zebra id... wich is fine but when i looked at the user data there was no zebra id as a foreign key leading back to the zebra table. I couldnt find where it defines the zebra id! the zebra id is basicly the user id i think but how would i link the zebra id with the user id and get it to display the users avatar as a friend or foe on the template file?!
Last edited by 2bit on 06 Aug 2008, 16:17, edited 1 time in total.

blazes816
Past Contributor
Past Contributor
Posts: 187
Joined: 07 Oct 2006, 03:00
Real name: Tyler
Location: Wichita, Kansas
Contact:

Re: friends and foes table?! toatly lost

Postby blazes816 » 04 Aug 2008, 04:07

User Number 9e071a3a594a8964cbefe784f8a6afaa94c0de17
My MODs:

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby 2bit » 04 Aug 2008, 17:44

:D wow ,
That cleared up alot! Thanks a bunch.
I am rather confused on the next step in the process. :oops:
I mean the zebra id keeps throwing me off. It easier to run a sql query on say the user avatar and have that display onto the template; but this example is toatly diffrent from that direct approach.
i guess the next step would be to come up with a script that converts the data into usable chunks?!

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby 2bit » 04 Aug 2008, 18:04


User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby igorw » 04 Aug 2008, 20:39

The foreign key is not on the users table, it's on the zebra table, and it's called "user_id".

- we're poor!

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby 2bit » 04 Aug 2008, 20:56


Elglobo
Past Contributor
Past Contributor
Posts: 120
Joined: 15 Jul 2008, 19:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby Elglobo » 05 Aug 2008, 00:22

: L'hébergement et l'assistance de votre forum phpBB en toute tranquillité.

- My First forum, créer votre forum phpBB3 facilement !

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby 2bit » 05 Aug 2008, 03:30

Thanks a bunch Elglobo,

That was cool of you to help out like that i owe you one. :D
I am going to soak this in a while to make shore i got it drilled in my head!

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: friends and foes table?! toatly lost

Postby 2bit » 06 Aug 2008, 16:07


User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: [blazes816] please look at last post/need advice

Postby igorw » 06 Aug 2008, 16:31


- we're poor!

blazes816
Past Contributor
Past Contributor
Posts: 187
Joined: 07 Oct 2006, 03:00
Real name: Tyler
Location: Wichita, Kansas
Contact:

Re: [blazes816] please look at last post/need advice

Postby blazes816 » 06 Aug 2008, 16:48

Sorry about neglecting this thread. Must have missed reading it before marking forums read. :D Don't worry, I won't again.

What are you currently having trouble with?

Also, I'm going to change the topic name to something descriptive so that others that could help know what it's about.
User Number 9e071a3a594a8964cbefe784f8a6afaa94c0de17
My MODs:

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with Friend/Foe page

Postby 2bit » 06 Aug 2008, 18:05

:D Thanks a bunch guys for clearing all of that up!
I was confused on what or whome was wright about the code. I had a feeling that he was wrong and that it was correct. I had to make shore because i am still learning and i dont want to be going over the wrong info trying to learn from that.

p.s. thanks for changing the topic to something better.

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with Friend/Foe page

Postby 2bit » 06 Aug 2008, 21:26


User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with Friend/Foe page

Postby igorw » 06 Aug 2008, 21:32


- we're poor!

User avatar
2bit
New member
New member
Posts: 23
Joined: 01 Aug 2008, 23:34
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with Friend/Foe page

Postby 2bit » 06 Aug 2008, 21:35

It was a syntax error! nevermind


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 20 guests