Performs hack - Joomla! Forum - community, help and support


jeg har taget de sider performs bruger entry og den side en af mine venner har lavet og lagt sammen til en side, således @ resultatet står sammen med formen til @ indtaste

http://www.thuleab.dk/index.php?option=com_performs&formid=3&itemid=117

i det script han har lavet skulle en evt. hjemmeside url vises, men det gør den ikke
er der nogen der har tid, løst og lejlighed til @ prøve @ se hvorfor hjemmesiden ikke vises.

(det er de nederste 20-25 linier der er hans script)


på forhånd tak

code: select all

<?php
/**
* @version $id: performs.php,v 2.0 beta 2005/12/11 22:34:40 asasd exp $
* @package performs
* @copyright (c) 2005 ilhami kilic
* @license http://www.gnu.org/copyleft/gpl.html gnu/gpl
* @author ilhami kilic http://www.tuwitek.at
* joomla free software
*/

defined( '_valid_mos' ) or die( 'direct access location not allowed.' );

global $database,$mosconfig_live_site,$mosconfig_sitename,$mosconfig_mailfrom, $my, $mosconfig_debug;

require_once( $mosconfig_absolute_path."/administrator/components/com_performs/lib/lib_template.php" );
require_once( $mosconfig_absolute_path."/administrator/components/com_performs/lib/lib_valid.php" );
require_once( $mosconfig_absolute_path."/administrator/components/com_performs/lib/lib_phpform.php" );
require_once( $mosconfig_absolute_path."/administrator/components/com_performs/lib/mylib.php" );
require_once( $mosconfig_absolute_path."/administrator/components/com_performs/class.performs.php");

if (file_exists($mosconfig_absolute_path.'/components/com_performs/language/'.$mosconfig_lang.'.php')) {
  include($mosconfig_absolute_path.'/components/com_performs/language/'.$mosconfig_lang.'.php');
} else {
  include($mosconfig_absolute_path.'/components/com_performs/language/english.php');
}

$pdfavailable = file_exists($mosconfig_absolute_path.'/administrator/components/com_virtuemart/classes/pdf');

if (!is_numeric($_request['formid'])) die ("intruder alert 22!");
$formid = intval($_request['formid']);

//
//if(empty($formid))
//   return;
//   

/**
* first create phpform object, set parameters ,
* register session object.
*/

   //   moscommonhtml::loadoverlib();
moscommonhtml::loadcalendar();

//$myarrfields = $_session['arrfields'];
/*---------------------------------------------------------------------------*/
$oldname = session_name( 'pf_'.md5( $mosconfig_live_site ) );
if ($mosconfig_debug) echo '<div style="background-color:aliceblue;"><h2>previous session: </h2><h3>'.$oldname.'</h3></div>';
session_start();
$_session[md5('session_gid')]          = $my->gid;
$_session[md5('form_id')]          = $formid;
$_session[md5('pdfavailable')]     = $pdfavailable;
$_session[md5('session_user_id')]  = $my->id;

if ($mosconfig_debug) {
  $superglobals = array('$_request', '$_session', '$_get', '$_post', '$_server', '$_cookie', '$_env');
  foreach ($superglobals $supr) {
    echo '<h1>'.$supr.'</h1>';
    eval('while (list($key, $val) = each('.$supr.')) {echo "<div><b>".$key."</b> = <i>".$val."</i></div>";}');
  }
}
/*---------------------------------------------------------------------------*/
   $now = date( "y-m-d h:i:s", time()+$mosconfig_offset*60*60 );
   $form_query = "select * #__performs id='$formid' , published='1'"
   . "\n , access <= '". $my->gid ."'"
   . "\n , ( start_date = '0000-00-00 00:00:00' or start_date <= '$now'  )"
   . "\n , ( finish_date = '0000-00-00 00:00:00' or finish_date >= '$now' )"
   ;
   $database->setquery( $form_query );

   $form_data = null;
   if(!$database->loadobject($form_data)){
      echo "no form has been found!";
      return;

   }

if ( empty($myarrfields )) {
   $myarrfields=makearray($formid,$form_data->submitlabel,$form_data->includereset,$form_data->resetlabel);
//   $_session['arrfields']=$myarrfields;
}
   $objmyform = new phpform( "myform", $myarrfields );
   $objmyform->straction = $_server['request_uri'];
   $theme="performs";
   if(!empty($form_data->theme)){
      $theme=substr($form_data->theme,0,strpos($form_data->theme,'.'));
   }
   
   $objmyform->strskin = $mosconfig_absolute_path."/components/com_performs/skins/$theme/tpl_form.html";
   if($form_data->use_securityimages==1 && $my->id==0){
      $objmyform->use_securityimages = true;
      $objmyform->securityimagehelp =  $form_data->securityhelptext;
      $objmyform->securityimageerror =  $form_data->securityerrortext;
   }

   if($form_data->strmissingfieldmsg)
      $objmyform->strmissingfieldmsg = $form_data->strmissingfieldmsg;
   
   $objmyform->intro = $form_data->intro;
   if (!empty( $form_data->image )) {
      $objmyform->formimage=$mosconfig_live_site.'/images/stories/'.$form_data->image;
   }   
   
if ( $objmyform ) {
   $objmyform->bolshowwarnings = false;
   $objmyform->strmethod = "post";

   $strresult = $objmyform->make();

   $message = "";

  $dberror = 0;

if ($mosconfig_debug) echo "<h1>determining submittal</h1><hr>";

$showprintbuttons =  !($objmyform->bolfrmsubmited && $objmyform->bolformok);

   if ( $objmyform->bolfrmsubmited && $objmyform->bolformok ) {
      if(!empty($form_data->tablename)){
         $database->setquery($objmyform->formtosqlinsert( $form_data->tablename));
         if (!$database->query()) {
            echo $objmyform->formtosqlinsert( $form_data->tablename)."<br>";
            echo "<script> alert('".db_error_occurred."'); window.history.go(-1); </script>\n" ;
            $dberror = 1;
         }
      }

    if ($mosconfig_debug){
      echo "<h1>sending mail</h1><hr><blockquote>";
      echo "<div><b>form_data->mailit</b> = ".$form_data->mailit."</div>";
      echo "<div><b>form_data->mailalways</b> = ".$form_data->mailalways."</div>";
      echo "<div><b>dberror</b> = ".$dberror."</div>";
      echo "<div><b>mosconfig_mailfrom</b> = ".$mosconfig_mailfrom."</div>";
      echo "<div><b>form_data->from</b> = ".$form_data->from."</div>";
      echo "<div><b>form_data->emails</b> = ".$form_data->emails."</div>";
      echo "<div><b>form_data->mailsubject</b> = ".$form_data->mailsubject."</div>";
      echo "<div><b>my->email</b> = ".$my->email."</div>";
    }
      // see if should send email
         if($form_data->mailit=="1"){
          if ($form_data->mailalways=="1" || ($form_data->mailalways=="0" && !$dberror)) {
              if (strlen($form_data->from) == 0) {
if ($mosconfig_debug){
              if ($mosconfig_debug) echo '<div style="background-color:wheat;"><b>from null</b></div>';
              }
                  $from_addr = $mosconfig_sitename."<".$mosconfig_mailfrom.">";
            } else {
                  $from_addr = $form_data->from;
            }

              if ( $form_data->useintro ) {
                  $form_intro = $form_data->intro;
              } else {
                  $form_intro = "";
            }
            if ($mosconfig_debug){
              echo '<div style="background-color:aliceblue;padding:24pt;">';
            }         
          if ( isset($my->email) ) {
            $objmyform->formtoemail( $my->username,
                                     $my->email,
                                     $form_data->emails,
                                     $form_data->mailsubject,
                                     $form_intro
                                     );
            $objmyform->formtoemail( $mosconfig_sitename,
                                     $mosconfig_mailfrom,
                                     $my->email,
                                     $form_data->mailsubject,
                                     $form_intro
                                     );
          } else {
            $objmyform->formtoemail( $mosconfig_sitename,
                                     $mosconfig_mailfrom,
                                     $form_data->emails,
                                     $form_data->mailsubject,
                                     $form_intro
                                     );
          }
           
            if ($mosconfig_debug){
              echo '</div>';
            }
          } else {
          if ($mosconfig_debug){
            echo "<h1>db error</h1><hr>";
            echo "<div>form_data->mailit = ".$form_data->mailit."</div>";
            echo "<div>form_data->mailalways = ".$form_data->mailalways."</div>";
          }
        }
       } else {
        if ($mosconfig_debug){
          echo '<h1 style="color:red;">mailit == false</h1><hr>';
        }
      }
      if($form_data->asub=="1"){
         header("location: ".$form_data->r_url);
         exit();
      }
      
    $strresult = $objmyform->replacevars($form_data->note);
   
    if ($mosconfig_debug){
      echo '<div><b>strresult</b> = '.$strresult.'</div>';     
      echo "</blockquote><hr />";
    }

   } else {
    if ($mosconfig_debug){
      echo '<h1 style="color:red;">not submitted</h1>';
    }
  }
   /*
   else {
      $message = $form_data->intro;
   }
   */
}

?>
  <table class="contentpaneopen">
      <tbody><tr>
         <td class="contentheading" width="100%"><?php echo $form_data->title; ?></td>
      <td style="">
<?php
if ($showprintbuttons) {
?>
<table><tr>
      <td>

<?php
  $strhref = 'components/com_performs/performspreview.php';
  $strposturl = $mosconfig_live_site.'/components/com_performs/performspreview.php';
  $strdownload = "printer friendly";
  $strimageloc = $mosconfig_live_site.'/images/html_f2.png';
?>
<!--
        <form target="_blank" name="viewhtml" action="<?php echo $strposturl; ?>" method="post">
          <input type="hidden" name="printing" value="true">
          <input type="image" title="<?php echo $strdownload; ?>" value="<?php echo $strdownload; ?>" src="<?php echo $strimageloc; ?>" onclick="submit();" >
        </form>
-->
 <img title="<?php echo $strdownload; ?>" alt="<?php echo $strdownload; ?>"
onclick="window.open('<?php echo $strhref; ?>', 'win1',
                     'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=yes');"
src=<?php echo '"'.$mosconfig_live_site.'/images/html_f2.png"'; ?> />

      </td>
<?php
      if ($pdfavailable) {
        $strdownload = "download pdf";
        $strimageloc = $mosconfig_live_site.'/administrator/components/com_performs/images/acroread.png';
        ?>
          <td>
          <form name="viewpdf" action="<?php echo $strposturl; ?>" method="post">
          <input type="hidden" name="printing" value="true">
<!--          <input type="hidden" name="formid" value="<?php echo $form_data->id; ?>"> -->
          <input type="hidden" name="pdf" value="<?php echo $pdfavailable ? 'true' : 'false' ; ?>"> 
          <input type="image" title="<?php echo $strdownload; ?>" value="<?php echo $strdownload; ?>" src="<?php echo $strimageloc; ?>" onclick="viewpdf.submit();" >
          </form>
          </td>
      <?php
      }
?></td></tr></table>
  <?php } ?>
      </td>
      </tr>
   </tbody></table><br>
<?php
// start table og overskrift på data
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0 \">";
echo "<tr><th>name</th>  <th>email</th>  <th>workplace</th>  <th>dorm  </th>  <th>year</th>  <th>homepage</th></tr>";

   // definere forspørgelse
   $query = "select name,email,workplace,dorm,year,homepage usr_performs_table3";

   // hent data database, og den gem et array
   $data = mysql_query($query);

   // hent data array, og sæt dem ind variabler
   while($res = @mysql_fetch_array($data)) {
      list ($name, $email, $workplace, $dorm, $year, $url)= $res;
      
      // skriv en række tabelen, med data fra variablerne.
      echo "<tr><td>$name   </td>";
      echo "<td><a href=\"mailto:$email\">$email</a>   </td>";
      echo "<td>$workplace   </td>";
      echo "<td>$dorm   </td>";
      echo "<td>$year   </td>";
      // hvis vekkommende har en home page, vises et link.
      if ($homepage) {
         $homepage = preg_replace("#((?:https?|ftp)://[\w./?=&%]+(?!\.))#i", "<a href='$1'>$1</a>", $homepage);
         echo "<td><a href=\"$url>homepage</a></td>";
      }
      else {
         echo " <td></td>";
      }      
      echo "</tr>";

        }
echo "</table>";
?><br><br>
   
<?php
   echo $strresult;

?>


<-- mod note zimmik: overskriftens begyndelsesbogstav er rettet til stort -->






Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code