Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 PHP doesn't work... D:
jonathan.95. Offline
Junior Member
**
Posts: 9
Joined: Mar 2011
Post: #1
PHP doesn't work... D:
Hi everyone

first of all forgive me for my bad english.

Then... 2 days ago our forum was hackered and I had to redo all.

So I take this chance for put the new version of mybb, at the begin all it was good but when I re-installed the "PHP TEMPLATES PLUGIN" (that make you able to use php in templates) it doesn't work and in the members profiles (where I used it) appears:

   

Before that I installed mybb it worked, but after the hacker it didn't

what can be the problem?
03-03-2011 03:08 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: PHP doesn't work... D:
(03-03-2011 03:08 PM)jonathan.95. Wrote:  what can be the problem?
Code you put in the templates is bad.

My Blog
03-03-2011 04:40 PM
Find all posts by this user Quote this message in a reply
jonathan.95. Offline
Junior Member
**
Posts: 9
Joined: Mar 2011
Post: #3
RE: PHP doesn't work... D:
(03-03-2011 04:40 PM)ZiNgA BuRgA Wrote:  
(03-03-2011 03:08 PM)jonathan.95. Wrote:  what can be the problem?
Code you put in the templates is bad.

It is the same code that was before, before it works.
03-03-2011 10:28 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: PHP doesn't work... D:
What is the code?

03-04-2011 01:39 AM
Find all posts by this user Quote this message in a reply
jonathan.95. Offline
Junior Member
**
Posts: 9
Joined: Mar 2011
Post: #5
RE: PHP doesn't work... D:
(03-04-2011 01:39 AM)RateU Wrote:  What is the code?


This:

PHP Code:
1
2
3
4
5
6
7
<?php
$groups = $db->query("SELECT usergroup,displaygroup FROM mybb_users WHERE uid='{$memprofile['uid']}'");
while($group = mysql_fetch_array($groups))
if($group['usergroup'] == 42 OR $group['displaygroup'] == 42){
echo '<div style="position: absolute; top: 165px;left: -3px; background: transparent url(http://img1.cdn1.habbo.com/c_images/stickers/summer_swim_trunk.gif); width: 83px; height:53px;">';
}
?>


And this:

PHP Code:
<?php  $getcomments=$db->query("SELECT * FROM mybb_profilecomments WHERE user='{$memprofile['uid']}'");
 $numcomments = mysql_num_rows($getcomments); ?><div style="float: right;"> Totale commenti: <?php echo $numcomments; ?>

03-04-2011 04:22 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: PHP doesn't work... D:
And why are you mixing the MyBB DB abstraction layer with mysql_* functions?

Replace mysql_fetch_array with $db->fetch_array and mysql_num_rows with $db->num_rows

My Blog
(This post was last modified: 03-04-2011 05:58 PM by ZiNgA BuRgA.)
03-04-2011 05:58 PM
Find all posts by this user Quote this message in a reply
jonathan.95. Offline
Junior Member
**
Posts: 9
Joined: Mar 2011
Post: #7
RE: PHP doesn't work... D:
Thanks D:

I love you!

Last thing...

PHP Code:
1
2
3
4
5
6
7
8
if ($i==1)
{
$i=2;
}
else
{
$i=1;
}


I usually use it for make 2 tr with different color, now it doesn't works... can you help me please?

03-04-2011 11:38 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: PHP doesn't work... D:
Nope, cause I don't really understand you... >_>

My Blog
03-05-2011 08:53 AM
Find all posts by this user Quote this message in a reply
jonathan.95. Offline
Junior Member
**
Posts: 9
Joined: Mar 2011
Post: #9
RE: PHP doesn't work... D:
(03-05-2011 08:53 AM)ZiNgA BuRgA Wrote:  Nope, cause I don't really understand you... >_>

ç__ç

I use that code for make:

<tr class="trow1">
<tr class="trow2">


Because of :

<tr class="trow$i">

ç_ç

Hope that you understand *-*

Just wanna make an if that makes 2 different number for the "tr" *-*
03-05-2011 03:42 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #10
RE: PHP doesn't work... D:
You haven't said what template it is in, but anyway, maybe this:

HTML Code
<tr class="trow<?php echo 1+($x=($x?0:1)); ?>">

I'm using $x because $i may be used elsewhere.


My Blog
03-05-2011 06:34 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: