![]() |
|
#1
|
|||
|
|||
|
I installed a php script and it is on the top of the page I cant get it to go to the center of page http://www.gridirontalk.com/cmps_ind...ortsbook-bonus The CMPS is calling the php script from the module folder
Can anyone give me any suggestions. Thanks in advance |
|
#2
|
|||
|
|||
|
The placement of modules is controlled from the admincp.
|
|
#3
|
|||
|
|||
|
Quote:
|
|
#5
|
|||
|
|||
|
I am still lost because I dont really understand what he did.
|
|
#6
|
|||
|
|||
|
Can anyone help me out I need to get this up. I will pay to get it done
|
|
#7
|
||||
|
||||
|
Quote:
|
|
#8
|
|||
|
|||
|
That is the code thats in the Module folder
Quote:
|
|
#9
|
||||
|
||||
|
Quote:
)...1. Create a new template to display the results of your module. In my case I created a generic one called "adv_portal_script_results" with the following code...... Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%"> <tr> <td class="tcat"> <span class="smallfont"> <strong>$vba_options[portal_blockbullet] $mods[title]</strong> </span> </td> </tr> <tr><td class="$getbgrow" width="100%">$content</td></tr> </table> <br /> 3. Add the following code to the top of your PHP module (right below the "<?" line.... Code:
// Start our object ob_start(); Code:
// End our object
ob_end_clean();
// Fetch the vBadvanced template to display the results
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_script_results') . '";');
6. Test & tweak as necessary. 7. Let me know if works (again, the gray cells aren't necessarily working yet today so I may have missed something).
|
|
#10
|
||||
|
||||
|
An easier way... Just create the template as KW802 suggested, then remove the 'echo $content;' part from the bottom of the file and that should do the trick.
|
|
#11
|
|||
|
|||
|
Seemd to have worked Thanks alot.
|
|
#12
|
||||
|
||||
|
Quote:
|
|
#13
|
||||
|
||||
|
That should only be necessary when a lot of the content is echoed. Since all of the content is already put into a variable, then you don't really need the other coding.
|
|
#14
|
||||
|
||||
|
Quote:
|
|
#15
|
|||
|
|||
|
Hi im having the same problem. I tried the method above to no avail. Im using a php script that i placed in my module folder. Heres the code of the php page
Code:
<html>
<head>
<link rel="stylesheet" type="text/css" href="bnet.css">
</head>
<body bgcolor="#000000">
<center><table width="1%">
<tr>
<td>
<?php
include("show_ladder.php");
?>
</td>
</tr>
</table>
</center>
</body>
</html>
Someone please help. Last edited by RiSE; 07-24-2004 at 02:02 AM. |
|
#16
|
|||
|
|||
|
Can anyone please help me out? :-\ :-\
|
|
#17
|
||||
|
||||
|
I'd need to see the code in "show_ladder.php" and the template you added.
|
|
#18
|
|||
|
|||
|
Heres the code. And i used the template someone posted by KW802 .
Code:
<?php
// (c)2003 by zuLu.TrunkZ
if (!empty($_GET)){
extract($_GET);
}else if (!empty($HTTP_GET_VARS)){
extract($HTTP_GET_VARS);
}
if (!empty($_POST)){
extract($_POST);
}else if (!empty($HTTP_POST_VARS)){
extract($HTTP_POST_VARS);
}
include("config.inc.php");
include($functions_file);
echo($ueberschrift);
$activeladders = array($active_solo, $active_rt, $active_ffa, $active_at2v2, $active_at3v3, $active_at4v4);
$ladders = array("solo", "rt", "ffa", "at2v2", "at3v3", "at4v4");
$ladderbez = array($bez_solo, $bez_rt, $bez_ffa, $bez_at2v2, $bez_at3v3, $bez_at4v4);
for($i=0;$i<6;$i++){
if(!$activeladders[$i]){
unset($activeladders[$i]);
unset($ladders[$i]);
unset($ladderbez[$i]);
}
}
$activeladders = array_values($activeladders);
$ladders = array_values($ladders);
$ladderbez = array_values($ladderbez);
if(!$ladder) $ladder = $ladders[$startladder];
ladder($page,$pps,$ladder);
function gettemplate($nb){
$sql = "Select template from ladder_design where id='$nb'";
return str_replace("\"","\\\"",get_mysql_value($sql));
}
function ladder($page,$pps,$ladder){
GLOBAL $startpps, $dsgn_fontsize, $dsgn_fontcolor, $dsgn_showunranked, $dsgn_titlebgcolor, $dsgn_titlebold, $dsgn_bordercolor,
$dsgn_border, $dsgn_bgcolor, $dsgn_rankcolor, $imagefolder, $dsgn_lvlbgcolor, $ladderpath, $dsgn_lvlbordercolor,
$dsgn_bgcolor1, $dsgn_bgcolor2, $dsgn_bnrankstyle, $dsgn_titlecolor, $dsgn_titlesize, $dsgn_bnrankstyle2;
// Vorbereitungen
$ladderpath2 = split("\?", $ladderpath);
$ladderpath2 = $ladderpath2[0];
if($ladder == "solo" or $ladder == "rt" or $ladder == "ffa"){
$laddertype = "solo";
$player = "Player";
$ladder_nb = 0;
$sql_table = $ladder;
}
else{
$laddertype = $ladder;
$player = "Teams";
if($ladder == "at2v2"){
$ladder_nb = 1;
$sql_table = "2v2";
}
elseif($ladder == "at3v3"){
$ladder_nb = 2;
$sql_table = "3v3";
}
elseif($ladder == "at4v4"){
$ladder_nb = 3;
$sql_table = "4v4";
}
}
if(!$dsgn_bgcolor) $dualbg = 1;
if(!$pps){$pps=$startpps;}
$page2 = $page;
$page2--;
$beginfrom2 = $pps * $page2;
$sql = "Select * FROM ladder_".$sql_table." order by reihenfolge desc";
$account = get_mysql_rows($sql);
$nb_accs = count($account);
if($pps>$nb_accs){$pps=$nb_accs;}
$listend = $beginfrom2 + $pps;
$beginfrom = $beginfrom2 + 1;
$page = $page2 + 1;
if(($pps * $page) > $nb_accs){
$nb_player = $nb_accs % $pps;
}
else{
$nb_player = $pps;
}
if($nb_accs%$pps == "0"){
$lastpage = $nb_accs/$pps;
}
else{
$lastpage = floor($nb_accs/$pps) + 1;
}
$chose_ladder = chose_ladder($ladder);
$chose_page = pages($nb_accs,$page,$pps,$ladder);
if($page == "1"){
$prevpage = $lastpage;
}
else{
$prevpage = $page - 1;
}
if($page == $lastpage){
$nextpage = "1";
}
else{
$nextpage = $page + 1;
}
// Templates + Ausgabe
for($i=$beginfrom2;$i<$listend;$i++){
if($account[$i][0]){
if($laddertype == "solo"){
$name = $account[$i][0];
$level = $account[$i][1];
$wins = $account[$i][2];
$losses = $account[$i][3];
$exp = $account[$i][5];
$percent = $account[$i][6];
$bnrank = $account[$i][7];
$pic = '<img src="'.$imagefolder.'/'.get_pic($name).'.gif" border="0">';
}
elseif($laddertype == "at2v2"){
$name1 = $account[$i][0];
$name2 = $account[$i][1];
$level = $account[$i][2];
$wins = $account[$i][3];
$losses = $account[$i][4];
$percent = $account[$i][6];
$bnrank = $account[$i][7];
$pic1 = '<img src="'.$imagefolder.'/'.get_pic($name1).'.gif" border="0">';
$pic2 = '<img src="'.$imagefolder.'/'.get_pic($name2).'.gif" border="0">';
}
elseif($laddertype == "at3v3"){
$name1 = $account[$i][0];
$name2 = $account[$i][1];
$name3 = $account[$i][2];
$level = $account[$i][3];
$wins = $account[$i][4];
$losses = $account[$i][5];
$percent = $account[$i][7];
$bnrank = $account[$i][8];
$pic1 = '<img src="'.$imagefolder.'/'.get_pic($name1).'.gif" border="0">';
$pic2 = '<img src="'.$imagefolder.'/'.get_pic($name2).'.gif" border="0">';
$pic3 = '<img src="'.$imagefolder.'/'.get_pic($name3).'.gif" border="0">';
}
elseif($laddertype == "at4v4"){
$name1 = $account[$i][0];
$name2 = $account[$i][1];
$name3 = $account[$i][2];
$name4 = $account[$i][3];
$level = $account[$i][4];
$wins = $account[$i][5];
$losses = $account[$i][6];
$percent = $account[$i][8];
$bnrank = $account[$i][9];
$pic1 = '<img src="'.$imagefolder.'/'.get_pic($name1).'.gif" border="0">';
$pic2 = '<img src="'.$imagefolder.'/'.get_pic($name2).'.gif" border="0">';
$pic3 = '<img src="'.$imagefolder.'/'.get_pic($name3).'.gif" border="0">';
$pic4 = '<img src="'.$imagefolder.'/'.get_pic($name4).'.gif" border="0">';
}
$percent2 = 100 - $percent;
$rank = $i + 1;
if($dsgn_bnrankstyle){
if($rank%10 == "1" and $rank%100 != "11"){
$rank = $rank."<sup>st</sup>";
}
elseif($rank%10 == "2" and $rank%100 != "12"){
$rank = $rank."<sup>nd</sup>";
}
elseif($rank%10 == "3" and $rank%100 != "13"){
$rank = $rank."<sup>rd</sup>";
}
else{
$rank = $rank."<sup>th</sup>";
}
}
if($bnrank){
if($dsgn_bnrankstyle2){
if($bnrank%10 == "1" and $bnrank%100 != "11"){
$bnrank = $bnrank."<sup>st</sup>";
}
elseif($bnrank%10 == "2" and $bnrank%100 != "12"){
$bnrank = $bnrank."<sup>nd</sup>";
}
elseif($bnrank%10 == "3" and $bnrank%100 != "13"){
$bnrank = $bnrank."<sup>rd</sup>";
}
else{
$bnrank = $bnrank."<sup>th</sup>";
}
}
if($dsgn_rankcolor) $bnrank = "<font color=\"".$dsgn_rankcolor."\">".$bnrank."</font>";
}
else{
if($dsgn_showunranked){
$bnrank = "Unranked";
}
else{
$bnrank = "";
}
}
$tmp=1;
if($dualbg){
if($i%2 == "0" or $i == "0"){
$dsgn_bgcolor = $dsgn_bgcolor1;
}
else{
$dsgn_bgcolor = $dsgn_bgcolor2;
}
}
eval("\$rows .= \"".gettemplate(3 + $ladder_nb * 3)."\";");
if($dualbg) unset($dsgn_bgcolor);
}
}
if(!$tmp){
$nb_player = "0";
$beginfrom = "0";
$nb_accs = "0";
eval("\$rows = \"".gettemplate(4 + $ladder_nb * 3)."\";");
}
eval("\$table = \"".gettemplate(2 + $ladder_nb * 3)."\";");
eval("echo(\"".gettemplate(1)."\");");
}
function chose_ladder($cur){
GLOBAL $dsgn_fontsize, $dsgn_fontcolor, $ladders, $ladderbez, $ladderpath, $dsgn_seperator;
$nb_ladders = count($ladders);
for($i=0;$i<$nb_ladders;$i++){
if($ladders[$i]){
if($cur == $ladders[$i]){
$output .= "<b>".$ladderbez[$i]."</b>";
}
else{
$output .= "<a href=\"".$ladderpath."ladder=".$ladders[$i]."\">".$ladderbez[$i]."</a>";
}
if($i != ($nb_ladders - 1)){
$output .= " ".$dsgn_seperator." ";
}
}
}
return $output;
}
// Ladder Script by zuLu.TrunkZ
function pages($nb_accs,$page,$pps,$ladder){
GLOBAL $dsgn_fontsize, $dsgn_fontcolor, $ladderpath, $dsgn_seperator2, $dsgn_site;
$output = $dsgn_site." ";
$maxpages = $nb_accs / $pps;
$maxpages = floor($maxpages);
if($nb_accs -($maxpages * $pps) != 0){
$maxpages = $maxpages + 1;
}
$maxpages2 = $maxpages + 1;
if($maxpages2 > 25){
$max = 25;
}
else{
$max = $maxpages2;
}
for($i=1;$i<$max;$i++){;
if($i==$page){
$output .= "<b>".$i."</b>";
}
else{
$output .= "<a href=\"".$ladderpath."ladder=".$ladder."&page=".$i."&pps=".$pps."\">".$i."</a>";
}
if($i != $maxpages){$output .= " ".$dsgn_seperator2 ." ";
}
}
return $output;
}
do_not_remove_please($dsgn_fontsize,$dsgn_fontcolor);
?>
|
|
#19
|
||||
|
||||
|
Have you taken a look at this thread? If that one doesn't help then it will most likely require a bit of work to get that script to work with vBa.
|
|
#20
|
|||
|
|||
|
Yes i read it but i dont understand what he did. I dont know how to edit the code to my needs. Im not a php whiz =\ (yet)
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP in module - just cant get it? | maximux1 | Troubleshooting / "How do I..." Questions | 26 | 02-18-2005 02:41 PM |
| Module will not center?? | DarknessDivine | Troubleshooting / "How do I..." Questions | 6 | 07-18-2004 02:08 PM |
| Embedding a entire website url into a CMPS PAGE module | djmjwhit | Troubleshooting / "How do I..." Questions | 1 | 06-19-2004 11:50 AM |
| Page or Module? | poseidon | Troubleshooting / "How do I..." Questions | 2 | 05-20-2004 11:43 AM |