интеграция на phpbb3 с wow сайт

val4o0o0

Registered
Така значи искам да обединя phpbb3 регистрациите с моя сайт, ето го кода от регистрацията за сайта:

Код:
<?php
if(INCLUDED!==true)exit;
// ==================== //
$pathway_info[] = array('title'=>$lang['register'],'link'=>'');

if ((int)$MW->getConfig->generic->site_register == 0)
{
      output_message('alert','Registration: Locked');
}
else
{
      $regparams = array(
                  'MIN_LOGIN_L' => 3,
                  'MAX_LOGIN_L' => 16,
                  'MIN_PASS_L'  => 4,
                  'MAX_PASS_L'  => 16
                  );
      // ==================== //
      if($user['id']>0){
            redirect('index.php?n=account&sub=manage',1);
      }
      $allow_reg = true;
      $err_array = array();
      $err_array[0] = $lang['ref_fail'];
      if($_POST['step'] && (int)$MW->getConfig->generic->req_reg_key){
            if($auth->isvalidregkey($_POST['r_key'])!==true){
                  output_message('alert',$lang['bad_reg_key']);
                  $allow_reg = false;
                  $err_array[] = "Your registration key was invalid. Please check it for typos.";
		  log_error("Account creation: On account registrer the key ".$_POST['r_key']." was not valid.");
            }
      }
      if((int)$MW->getConfig->generic->max_accounts_per_ip>0){
            $count_ip = $DB->selectCell("SELECT count(*) FROM account_extend WHERE registration_ip=?",$_SERVER['REMOTE_ADDR']);
            if($count_ip>=(int)$MW->getConfig->generic->max_accounts_per_ip){
                  output_message('alert',$lang['reg_acclimit']);
                  $allow_reg = false;
                  $err_array[] = "You are not allowed to create any more accounts. If you feel this is in error, please contact the administrator.";
                  $err_array[] = "If you are registering through a shared connection, it is advised that you use a private connection for registration.";
		  log_error("Account Creation: User with ip ".$_SERVER['REMOTE_ADDR']." is not allowed to create more than ".(int)$MW->getConfig->generic->max_accounts_per_ip." per IP.");
            }
      }
      if($_POST['step']==3){
            if($allow_reg === true){
                  $notreturn = FALSE; // Inizialize variable, we use this after. Use this to add extensions.
	  
                  // Extensions
                  // Each extention you see down-under will check for specific user input,
                  // In this step we set "requirements" for what user may input.
	  
                  // Ext 1.
                  if ((int)$MW->getConfig->generic_values->account_registrer->enable_image_verfication){
                        $image_key =& $_POST['image_key'];
                        $filename=quote_smart($_POST['filename_image']);
                        
                        $correctkey = $DB->selectCell("SELECT acc_creation_captcha.key FROM acc_creation_captcha WHERE filename=".$filename);
                        if (strtolower($correctkey) != strtolower($image_key) || $image_key == ''){
                              $notreturn = TRUE;
                              $err_array[] = "Написания код от картинката не е верен.";
                              log_error("Account Creation: Image verfication error, user didn't type the image right.In DB: ".$correctkey." , user input: ".strtolower($image_key).".");
                        }
                  }
                  // Ext 2 check
                  /* Check 3 - secret questions*/
                  if ((int)$MW->getConfig->generic_values->account_registrer->secret_questions_input){
                        if ($_POST['secretq1'] && $_POST['secretq2'] && $_POST['secreta1'] && $_POST['secreta2']) {
                              if(check_for_symbols($_POST['secreta1']) || check_for_symbols($_POST['secreta2'])){
                                    $notreturn = TRUE;
                                    $err_array[] = "Използвате забранени символи в отговорите на секретните въпроси.";
                              }
                              if($_POST['secretq1'] == $_POST['secretq2']) {
                                    $notreturn = TRUE;
                                    $err_array[] = "Секретните въпроси неможе да са еднакви.";
                              }
                              if($_POST['secreta1'] == $_POST['secreta2']) {
                                    $notreturn = TRUE;
                                    $err_array[] = "Отговорите в секретните въпроси неможе да са еднакви.";
                              }
                              if(strlen($_POST['secreta1']) < 4 || strlen($_POST['secreta2']) < 4) {
                                    $notreturn = TRUE;
                                    $err_array[] = "Отговорите в секретните въпроси трябва да са най-малко 4 символи.";
                              }
                        }
                        else {
                              $notreturn = TRUE;
                              $err_array[] = "Не си отговорил на секретните въпроси.";
                        }
		  }
      
                  // Ext 3 - make sure password is not username
                  if($_POST['r_login'] == $_POST['r_pass']) {
                        $notreturn = TRUE;
			$err_array[] = "Паролата неможе да е еднаква с акаунта.";
                  }
      
                  // Main add.
                  if ($notreturn === FALSE){
                        if($auth->register(array('username'=>$_POST['r_login'],'sha_pass_hash'=>sha_password($_POST['r_login'],$_POST['r_pass']),'sha_pass_hash2'=>sha_password($_POST['r_login'],$_POST['r_cpass']),'email'=>$_POST['r_email'],'expansion' =>$_POST['r_account_type'],'password' =>
                              $_POST['r_pass']), array('secretq1'=>strip_if_magic_quotes($_POST['secretq1']),'secreta1'=>strip_if_magic_quotes($_POST['secreta1']),'secretq2'=>strip_if_magic_quotes($_POST['secretq2']), 'secreta2'=>strip_if_magic_quotes($_POST['secreta2'])))===true){
                              if((int)$MW->getConfig->generic->req_reg_key)$auth->delete_key($_POST['r_key']);
                              if((int)$MW->getConfig->generic->req_reg_act == 0)$auth->login(array('username'=>$_POST['r_login'],'sha_pass_hash'=>sha_password($_POST['r_login'],$_POST['r_pass'])));
                              $reg_succ = true;
                        }else{
			      $reg_succ = false;
                              $err_array[] = "Account Creation [FATAL ERROR]: User cannot be created, likely due to incorrect database configuration.  Contact the administrator.";
                        }
                  }
                  else{
                        $reg_succ = false;
                  }
                  
                  //Error message
                  if($reg_succ == false) {
                        if(!$err_array[1]) {
                              $err_array[1] = $lang['ref_fail'].": Unknown Reason";
                        }
                        $output_error = implode("<br>\n",$err_array);
                        output_message('alert',$output_error);
                  }
            }
      }
}
?>
-------------------------
Другото нещо е за новините, последните 20 теми искам да се изнесът, но не само заглавията а и какво е съдържанието им, ето пример от сайта ми в момента:
10e6b5a47dea43571fbd04878966dba9_920x0.jpg

Сега обаче, се налага да пиша и в форума и в сайта, не искам това да се прави винаги, а да се извеждат, има кодове знам, но незнам как да ги пригодя, ето как са изведени новините в сайта:

Код:
<div style="margin-left: -29px">
<style media="screen" title="currentStyle" type="text/css">
@import url("<?php echo $currtmp; ?>/css/additional_fp.css");
</style>
<div id="module-container">


<![if !IE]>
<div style="width:470px;"></div>
<![endif]>
<?php 
$banner = (int)$MW->getConfig->generic->display_banner_flash ? 1 : 0;
if ($banner):
?>
<div id="flashcontainer">
<embed type="application/x-shockwave-flash" src="flash/loader2.swf" id="flashbanner" name="flashbanner" quality="high" wmode="transparent" flashvars="news.xml" height="340" width="500">
</div>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<?php else: ?>
    <img src="<?php echo $currtmp; ?>/images/banner1.jpg" alt="" width="500"/><br/>
<?php endif; ?>
</div>
<div class="module-container" <?php if ($banner==1) echo 'style="position: relative;"';?>>
<?php foreach($alltopics as $postanum => $topic){ 
    $postnum++;
    if($hl=='alt')$hl='';else $hl='alt';
?>                                                                  
    <script type="text/javascript">
        var postId<?php echo$postnum;?>="<?php echo $topic['topic_id'];?>";
    </script>
    <div class="news-expand" id="news<?php echo $topic['topic_id'];?>">
      <div class="news-border-left"></div>
      <div class="news-border-right"></div>
      <div class="news-listing">
        <div onclick="javascript:toggleEntry('<?php echo $topic['topic_id'];?>','<?php echo$hl;?>')" onmouseout="javascript:this.style.background='none'" onmouseover="javascript:this.style.background='#EEDB99'" class="hoverContainer">
          <div>
            <div class="news-top">
              <ul>
                <li class="item-icon">
                  <img border="0" alt="new-post" src="<?php echo $currtmp; ?>/images/news-contests.gif"/></li>
                <li class="news-entry">
                  <h1>
                    <a href="javascript:dummyFunction();"><?php echo $topic['topic_name'];?></a>
                  </h1>
                  <span class="user">Написана от: <b><?php echo $topic['topic_poster'];?></b> |</span><span class="posted-date"><?php echo date('d-m-Y',$topic['topic_posted']);?></span>
                </li>
                <li class="news-entry-date">
                  <span><strong><?php echo date('d-m-Y',$topic['topic_posted']);?> </strong></span>
                </li>
                <li class="news-toggle">
                  <a href="javascript:toggleEntry('<?php echo $topic['topic_id'];?>','<?php echo$hl;?>')"><img src="<?php echo $currtmp; ?>/images/pixel001.gif" alt=""/></a>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="news-item">
        <blockquote>
          <dl>
            <dd>
              <ul>
                <li>
                  <div class="letter-box0"></div>
                  <div class="blog-post">
                    <?php echo $topic['message'];?>
                    <div align="right">
                     
                    </div>                
                  </div>                
                </li>
              </ul>
            </dd>
          </dl>
        </blockquote>
      </div>
    </div>
    <script type="text/javascript"></script>
<?php }
unset($alltopics, $hl, $postnum);
?>                                                                
</div>




<center><div id="box2">
<h3>Платена реклама:</h3>
</div></center>
<center><script type="text/javascript">
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<a href="http://www.xpr0.com/bg/garage/51620/invite-friend"><img border=0 src="http://www.xpr0.com/banner/51620" width="468" height="49"></a><a href="http://www.xpr0.com/bg/garage/51620/invite-friend"></a>
</center>

ПП: При регистрация на форума се изисква:
http://wow-multimedia.org/forum/ucp.php?mode=register
A при сайта:
http://wow-multimedia.org/index.php?n=account&sub=register
 
това доколкото разбирам е за самия вход, на мен ми трябва за самата регистрация, тоест направилите си акаунт от сайта да бъдат регистрирани и във форума без да се налага регистрация от там.

ПП:
Код:
  @mysql_connect("localhost", "potrebitel", "parola"); //host, user, pass
 @mysql_select_db("baza danni"); // baza danni
 $pass=md5($password);
 $user_join=time();
 $userip=$_SERVER['REMOTE_ADDR'];

 $query2=mysql_query(
 
 "INSERT INTO e107_user (
 `user_name`, `user_loginname`, `user_password`, `user_email`, `user_customtitle`, `user_sess`, `user_signature`, `user_image`, `user_timezone`,`user_hideemail`, `user_join`, `user_lastvisit`, `user_currentvisit`,`user_lastpost`,`user_chats`,`user_comments`,`user_forums`,`user_ip`,`user_ban`,`user_prefs`,`user_new`,`user_viewed`,`user_visits`,`user_admin`,`user_login`,`user_class`,`user_perms`,`user_pwchange`,`user_xup`)
 
 
 VALUES('
 $nickname','$nickname','$pass','$email_address', '', '', '', '', '', '0', '$user_join', '$user_join', '$user_join','0','0','0','0','$userip','0','0','','','0','0','','','','$user_join','');") or die(mysql_error());

Това е за е107, някой може ли да го едитне за phpbb3?
 

Back
Горе