You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 3 of 4)
Thanks a lot Dr.Jeckyl..
What I was asked to do today was do a "Joomla integration with a CSS site". The person wanted modules and menus installed using Joomla to work with this site here. I have seen a fair amount of Joomla but it always seemed fairly bloated to me so I never experimented with it. If I knew a bit about it maybe I could have taken them up on their offer. Would you have done it? Does that seem like fair pay?
Okay I will try to explain my goal..
I am trying to display challenges. Here is an example of a page they will be displayed on.
I will make comments in the script..
<?php
// query to set up appropriate player challenges
$imatch_id = intval($_GET['imatch_id']);
$result = $db->query("SELECT * FROM ".$db->prefix."ladders WHERE imatch_id=$imatch_id") or error('Query failed', __FILE__, __LINE__, $db->error());
?>
<br />
<?php echo $line['username'].'\'s pending challenges:' ?></dt><br />
<?php
//while loop here could be totally wrong, using to examine all matches listed....
while ($row = $db->fetch_assoc($result))
{
//if there is a match listed where the playerb's name is equal to the name of the player whose profile page it is ($line['username']) then it will show this match
if ($row['playerb'] == $line['username'])
{
//when it finds above, it lists the playera and the playerb for that match
echo $row['playera'].'has a challenge against'.$row['playerb'].'(awaiting winner)';
}
else
{
//if these possibilities do not occur then echo no current challenges
echo 'No current challenges';
}
}
?>
<?php
// query to set up appropriate player challenges
$query = "SELECT * FROM punbb2_ladders WHERE imatch_id=$imatch_id";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$imatch_id = (int)$_GET['imatch_id'];
?>
<br />
<?php echo $line['username'].'\'s pending challenges:' ?></dt><br />
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{ if ($row['playerb'] == $line['username']) { echo $row['playera'].'has a challenge against'.$row['playerb'].'(awaiting winner)';
} else { echo 'No current challenges'; }
}
?>
I am trying to take that information that we INSERT from the thread "You're a genious if you figure this out", and display it on a page. The page is a custom user profile page; already set up. I am having trouble displaying the data. Any suggestions? Im pretty tired so Ima check this later. Replies plz
Smartys <3
Seriously! Thank you so much buddy.
playera and b is not intval though?
First query I didn't really know how to use. It was to try to check for the current value of imatch id which is set as primary key and auto incrememnt in the table i created for this thing. (ladders table)
Okay so, in the past two days I have gotten two offers of 50$USD each to work on peoples websites. Now this isnt really alot of money and considering the amount of time that certain things would take, I don't know if its worth it. The same thing happened a few weeks ago, and I agreed to help the person and they bailed out like the next day after I had done a bunch of shit.
Personally I don't see myself as being all that skilled of a programmer and somewhat lacking in style areas, especially css. Should I tell people that others would be better suited to what they want? For the types of prices I am getting offered it seems a little ridiculous. I don't know what do you think?
-took out a quote.
The redirect is working absolutely fine.
I used a print_r($_GET) to see if its actually grabbing the form inputs. It is only grabbing the imatch_id the rest are fukt idk y.
<form method="get" action="new_ichallenge.php" >
<center>
<input type="hidden" value="" id="imatch_id" name="imatch_id">
<input type="hidden" value="<?php $pun_user['username']?>" id="playera" name="playera">
<input type="hidden" value="<?php $line['username']?>" id="playerb" name="playerb">
<input type="submit" value="Challenge Player" name="submit">
</center>
</form>
Wow, what a f*king brilliant idea (excuse my language). Can't wait to see the results. I will give more feedback on ideas later.
Sure, here you go:
<?php
// PERFORM QUERY & POPULATE TABLE
$p=isset($_GET['p'])?(int)($_GET['p']-1)*15:0;
$query = 'SELECT id, username, iwins, ilosses, ipoints FROM punbb2_users' . ' ORDER by ipoints DESC, username ASC LIMIT '.$p.', 15' ;
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$id = '<a href="profile.php?id='.$line['id'].'">'.pun_htmlspecialchars($line['username']).'</a>' ;
if ($db->num_rows($result))
{
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
?>
<td class="tcl" scope="col"><?php echo '<a href="iprofile.php?id='.$line['id'].'">'.pun_htmlspecialchars($line['username']).'</a>' ?></td>
<td class="tc2" scope="col"><?php echo $line['iwins']; ?></td>
<td class="tc3" scope="col"><?php echo $line['ilosses']; ?></td>
<td class="tc4" scope="col"><center><?php echo $line['ipoints']; ?></center></td>
<?php
}
echo "\t</tr>\n";
}
echo "</table>\n";
//BEGIN PAGINATE
$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
$query_rows = $db->result($result);
$num_pages = ceil($query_rows / 15);
if (intval($_GET['p']) && $_GET['p'] <= $num_pages)
$cur_page = $_GET['p'];
$link_to = 'iladder.php?';
echo '<center>Page:'.paginate($num_pages, $cur_page, $link_to).'</center>';
//END PAGINATE
?>
There is a bit more to it than that, what's not there is some style stuff and the right block with links.
*updated link (this is now the link that users can use to see the ladder) Link
I figured it out. I changed..
$p = (int)$_GET['p']*15;
To
$p=isset($_GET['p'])?(int)($_GET['p']-1)*15:0;
I have this working almost properly, the only problem is that page one doesnt actually show the first 0 - 15 results, it shows 15-30
New code
$p = (int)$_GET['p']*15;
$query = 'SELECT id, username, iwins, ilosses, ipoints FROM punbb2_users' . ' ORDER by ipoints DESC, username ASC LIMIT '.$p.', 15' ;
$num_pages = ceil($query_rows / 15);
if (intval($_GET['p']) && $_GET['p'] <= $num_pages)
$cur_page = $_GET['p'];
Oh yeah, I don't even plan on testing it until it finishes beta.
We'll if 'you' yourself are the developer then obviously you will be the one to move them over. But the thing is, will the current functions.php be seriously altered for the new 1.3?
If you have alot of mods or custom scripts installed with a current version of punbb will it be hard to upgrade to 1.3?
First you must do some mysql editing to get the db in place for your mod to work.. so
Create a new field in the users table and call it clan_id or team_id
This will identify what team a user is in.
Create a new table called clans or teams w/e
Inside this table, put fields that will represent teams
id INT NOT NULL, auto increment,
clan_name varchar(xx)
Then depending on what you want the teams, clans to be able to do you will add new fields.
You will need to know php to be able to get everything working together with db. But its really not too hard of a mod to do. Good luck. There are many possibilities with this mod. If you make it leme know.
Okay I will check that out thanks, and the main thing is the different results per page. Any ideas?
Can I please get a reply on this?
Ill install this mod today or tomorrow and let you know how it goes for me. Sorry I can't be of more help.
Very nice, better than many in this forum I have seen.
"We were at The Armory highly suggest you create an account and engage in all the discussions related to Starcraft II. Help this community grow. Thank you."
Change We were to just We
Because you are honest. I read their tos, from what I remember it would seem that is against what they want.
if ($pun_user['g_id'] != 3) { show links }
Posts found: 51 to 75 of 91