vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Troubleshooting / "How do I..." Questions

 
 
Thread Tools Display Modes
  #1  
Old 07-20-2004, 11:08 AM
gridirontalk gridirontalk is offline
Junior Member
 
Join Date: Mar 2004
Posts: 22
Default How do I make php module move to center of page

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  
Old 07-20-2004, 11:39 AM
Morrus Morrus is offline
Member
 
Join Date: Feb 2004
Posts: 79
Default Re: How do I make php module move to center of page

The placement of modules is controlled from the admincp.
  #3  
Old 07-20-2004, 11:42 AM
gridirontalk gridirontalk is offline
Junior Member
 
Join Date: Mar 2004
Posts: 22
Default Re: How do I make php module move to center of page

Quote:
Originally Posted by Morrus
The placement of modules is controlled from the admincp.
I put it in the center but it still displays it up top
  #4  
Old 07-20-2004, 11:47 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: How do I make php module move to center of page

This post may help you.
  #5  
Old 07-20-2004, 01:02 PM
gridirontalk gridirontalk is offline
Junior Member
 
Join Date: Mar 2004
Posts: 22
Default Re: How do I make php module move to center of page

I am still lost because I dont really understand what he did.
  #6  
Old 07-20-2004, 07:48 PM
gridirontalk gridirontalk is offline
Junior Member
 
Join Date: Mar 2004
Posts: 22
Default Re: How do I make php module move to center of page

Can anyone help me out I need to get this up. I will pay to get it done
  #7  
Old 07-20-2004, 10:31 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How do I make php module move to center of page

Quote:
Originally Posted by gridirontalk
Can anyone help me out I need to get this up. I will pay to get it done
Let's start with the basics.... is the PHP code in question something that is OK to publicly post? If so post up the code here and and I'm sure one of us can hit it.
  #8  
Old 07-21-2004, 08:35 AM
gridirontalk gridirontalk is offline
Junior Member
 
Join Date: Mar 2004
Posts: 22
Default Re: How do I make php module move to center of page

That is the code thats in the Module folder

Quote:
<?



mysql_connect('localhost','gridiron_special','jjd$14X');

mysql_select_db('gridiron_special');



$c = -1;

$content .= "<table cellSpacing='0' cellPadding='1' width='100%' border='0'>\n";

$q = mysql_query("SELECT st.*,sn.Name FROM stores st,stores_names sn WHERE st.StoreID=sn.ID AND st.Approved=1 ORDER BY ID DESC LIMIT 0,10");

while($r=mysql_fetch_array($q)){

$c = $c * (-1);

if($c == 1){

$color= "bgColor='#eeeeee'";

}

else {

$color = "bgColor='#cccccc'";

}

if($r[Code]){

$r[Code] = '['.$r[Code].']';

}

$content .= "

<tr>

<td $color height='15'><b>

<span style='font-style:normal; font-variant:normal; font-size:10pt; font-family:arial'>$r[Name]</span><span style='FONT: 10pt arial'>-

<a href='$r[Url]' target='_blank'>$r[Title]</a></span></b></td>

</tr>

";

}

$content .= "</table>\n";



echo $content;



?>




  #9  
Old 07-21-2004, 09:17 AM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How do I make php module move to center of page

Quote:
Originally Posted by gridirontalk
That is the code thats in the Module folder
OK, if my gray cells are working today (I'm back at work after a long weekend and no caffiene yet )...

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 />
2. Remove the "echo $content;" from your module

3. Add the following code to the top of your PHP module (right below the "<?" line....
Code:
// Start our object
ob_start();
4. Add the following code to the bottom of your PHP module (right above the "?>" line....
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') . '";');
5. Change your module to update the 'Templates' used.

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  
Old 07-21-2004, 09:53 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: How do I make php module move to center of page

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  
Old 07-21-2004, 09:59 AM
gridirontalk gridirontalk is offline
Junior Member
 
Join Date: Mar 2004
Posts: 22
Default Re: How do I make php module move to center of page

Seemd to have worked Thanks alot.
  #12  
Old 07-21-2004, 10:02 AM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How do I make php module move to center of page

Quote:
Originally Posted by Brian
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.
Would he then not need the code for the object start, object end, and the template fetch inside of the PHP? I thought the template fetch was needed in the PHP code in order to pass in the result of the variable from the PHP to the template.
  #13  
Old 07-21-2004, 10:04 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: How do I make php module move to center of page

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  
Old 07-21-2004, 10:09 AM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: How do I make php module move to center of page

Quote:
Originally Posted by Brian
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.
That's good to know, thanks.
  #15  
Old 07-24-2004, 01:26 AM
RiSE RiSE is offline
Junior Member
 
Join Date: Jul 2004
Posts: 8
Default Re: How do I make php module move to center of page

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>
It keeps showing up on the top of the page above my portal. Heres an example http://www.clanggl.net/forum/index2.php?page=members
Someone please help.

Last edited by RiSE; 07-24-2004 at 02:02 AM.
  #16  
Old 07-24-2004, 11:05 AM
RiSE RiSE is offline
Junior Member
 
Join Date: Jul 2004
Posts: 8
Default Re: How do I make php module move to center of page

Can anyone please help me out? :-\ :-\
  #17  
Old 07-24-2004, 12:59 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: How do I make php module move to center of page

I'd need to see the code in "show_ladder.php" and the template you added.
  #18  
Old 07-24-2004, 04:25 PM
RiSE RiSE is offline
Junior Member
 
Join Date: Jul 2004
Posts: 8
Default Re: How do I make php module move to center of page

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  
Old 07-24-2004, 04:51 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: How do I make php module move to center of page

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  
Old 07-26-2004, 06:50 AM
RiSE RiSE is offline
Junior Member
 
Join Date: Jul 2004
Posts: 8
Default Re: How do I make php module move to center of page

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -4. The time now is 05:35 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.