Jump to content

alxne

New Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About alxne

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. When I add two colours to the circle, it no longer stays as a circle, it becomes much taller. attachment shows how the two coloured circle is no longer a circle (it's stretched), whereas the single colour circles are fine. Any ideas how to keep it circular? Css for single colour is color: #5fc75d; font-size: 1.2em; Css for two coloured circle is color: transparent; background: linear-gradient(to right, #5fc75d 0%, #5fc75d 50%, #f19e2d 50%, #f19e2d 100%); border-radius: 50%; font-size: 1.2em;
  2. The page loads within a few seconds. I didn't write it, as mentioned earlier I can't get hold of who wrote it for me.
  3. Thanks for the explanation but it's beyond my ability to figure out to make it work
  4. for($j<='2017';$j=$mindate;$j--) for($j<='2017';$j=$mindate;$j++) tried both of those and neither worked, tried the latter to see if it was the -- stopping it working but it wasn't
  5. Anytime I change that piece of code the page crashes. Probably as I don't know how it should be 2017 doesn't matter, it still works for years after that. Basically all data up for 2017 is stored in the database, but everything after is generated. I did that mainly to save page times.
  6. Sorry @requinix I'm not that good with this, it just looks a mess to me! Here's the whole thing <?php $competitions=array(); $competitions[]="Championship"; $competitions[]="Division One"; $competitions[]="Division One (old)"; $competitions[]="Division Two (old)"; $competitions[]="League One"; $competitions[]="Midland League"; $competitions[]="Premier League"; $competitions[]="South Regional League"; $competitions[]="Southern Section"; $competitions[]="Midland Division"; $competitions[]="North"; $competitions[]="South"; $competitions[]="Midland Section"; $competitions[]="FA Cup"; $competitions[]="League Cup"; $competitions[]="League Trophy"; $competitions[]="UEFA Champions League"; $competitions[]="UEFA Cup"; $competitions[]="UEFA Cup Winners Cup"; $competitions[]="Anglo-Italian Cup"; $competitions[]="Members Cup"; $competitions[]="War Cup"; $q="select max(date) as max_date,min(date) as min_date from seasonstats"; $qr=mysqli_query($ccppdbc, $q) or die($q.mysqli_error($ccppdbc)); $r=mysqli_fetch_object($qr); $max_date=$r->max_date; $max_dates=explode('-',$max_date); $maxdate=$max_dates[0]+1; $min_date=$r->min_date; $min_dates=explode('-',$min_date); $mindate=$min_dates[0]; $session_option="<select name=session class=jmp onchange='submit_form();'>"; $tr=0; $records="<div class='mainBox box_inner--border secondary table-responsive'><h1 class='history_title'>Top goalscorers</h1> <table class='table' cellspacing='0'> <tr class='ipsButtonBar ipsType_reset'> <th width=8%>Season</th> <th width=8%>Goals</th> <th width=84%>Players</td></th>"; for($j=$mindate;$j<='2017';$j++) { $value=substr($j+1,-2 ); $session_player=array(); $q="select t.playerid,t.goals,p.firstname,p.lastname,p.playerid from topscorers as t,players as p where t.goals is true and season='$j' and t.playerid=p.playerid"; $qr=mysqli_query($ccppdbc,$q) or die($q.mysqli_error($ccppdbc)); while($r=mysqli_fetch_object($qr)) { $pid=$r->playerid; $goals=$r->goals; $firstname=utf8_encode($r->firstname); $lastname=utf8_encode($r->lastname); $session_player[$pid]="$firstname $lastname"; } $total_record=count($session_player); $i=0; $palyerslink=''; foreach($session_player as $var=>$val) { $i++; if($i==$total_record) $palyerslink.="<a href=/history/players?pid=$var title='view this in more detail'>$val</a>"; else $palyerslink.="<a href=/history/players?pid=$var title='view this in more detail'>$val</a>, "; } if(!empty($session_player)) { $tr++; $records.="<tr class=ftrow> <td class=border-right><a href='/history/browse?season=$j'>$j-$value</a></td> <td class=border-right>$goals</td> <td>$palyerslink</td></tr>"; } } for($j='2018';$j<=$maxdate;$j++) { $value=substr($j+1,-2 ); //$val=$i; if($j==1890) continue; $session=$j; $session1=$session+1; $session_value=$session.'-08-01'; $session1_value=$session1.'-06-31'; $total_goals=0; $match_ids=array(); $session_player=array(); $q="select id from seasonstats where date >='$session_value' and date <='$session1_value' order by date"; $qr=mysqli_query($ccppdbc, $q) or die($q.mysqli_error($ccppdbc)); while($r=mysqli_fetch_object($qr)) { $match_ids[]=$r->id; } if(!empty($match_ids)) { $match_id_list=implode(',',$match_ids); $players_ids=array(); $q="select distinct(_player_id) from seasonteamstats where matchid in ($match_id_list) order by lastname"; $qr=mysqli_query($ccppdbc, $q) or die($mysqli_error($ccppdbc)); while($r=mysqli_fetch_object($qr)) { //$firstname=$r->firstname; //$lastname=$r->lastname; $playerid=$r->_player_id; $players_ids[$playerid]=$playerid; } //$players_names=array_unique($players_names); $total_players=count($players_ids); $max_goal_season=0; foreach($players_ids as $var=>$val) { $total_goals=0; $total_penalties=0; $q="select * from seasonteamstats where _player_id='$val' and matchid in ($match_id_list) order by lastname"; $qr=mysqli_query($ccppdbc, $q) or die($q.mysqli_error($ccppdbc)); while($r=mysqli_fetch_object($qr)) { $firstname=utf8_encode($r->firstname); $lastname=utf8_encode($r->lastname); $pid=$r->_player_id; if($session>=1915 and $session<=1918) { $goals=$r->wargoals1; $penalties=$r->warpenalties1; } elseif($session>=1939 and $session<=1945) { $goals=$r->wargoals; $penalties=$r->warpenalties; } else { $goals=$r->goals; $penalties=$r->penalties; } $total_goals+=$goals+$penalties; } if($max_goal_season==$total_goals) { $session_player[$pid]="$firstname $lastname"; } else if($max_goal_season<$total_goals) { $session_player=array(); $max_goal_season=$total_goals; $session_player[$pid]="$firstname $lastname"; } } } $total_record=count($session_player); $i=0; $palyerslink=""; foreach($session_player as $var=>$val) { $i++; if($i==$total_record) $palyerslink.="<a href='/history/players?pid=$var' title='view this in more detail'>$val</a>"; else $palyerslink.="<a href='/history/players?pid=$var' title='view this in more detail'>$val</a>, "; } if(!empty($session_player)) { $tr++; $records.="<tr class=ftrow> <td class=border-right><a href='/history/browse?season=$j'>$j-$value</a></td> <td class=border-right>$max_goal_season</td> <td>$palyerslink</td> </tr>"; } } $records.="</table></div>"; echo $records; ?>
  7. I have quite a long .php page but I've attached the end of it. I was wondering if I can change the order it is displayed. Basically $j is a year. And currently it goes from 1894 until 2019. I don't think anything is currently telling it to sort either way, it just by default shows that way. But I want it to show 2019 first and go down to 1894. I had this written for me by someone who I can no longer get hold of. $total_record=count($session_player); $i=0; $palyerslink=""; foreach($session_player as $var=>$val) { $i++; if($i==$total_record) $palyerslink.="<a href='/history/?pid=$var' title='view this in more detail'>$val</a>"; else $palyerslink.="<a href='/history/?pid=$var' title='view this in more detail'>$val</a>, "; } if(!empty($session_player)) { $tr++; $records.="<tr class=row> <td class=border-right><a href='/history/browse?season=$j'>$j-$value</a></td> <td class=border-right>$max_goal_season</td> <td>$palyerslink</td> </tr>"; } } $records.="</table></div>"; echo $records; ?> This is the end of the page where the records are then displayed using the echo. I'm not sure if more code is needed though, I could post it in full if needed
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.