форум vBSupport.ru > vBulletin > vBulletin 3.8.x > Хаки, моды и скрипты 3.8
  • »
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
 
 
 
 
cviktor
Простоузер
Default Динамическая подгрузка в модуль CMPS
0

Подскажите пожалуйста как можно подгрузить скрипт в модуль vBadvanced CMPS без перезагрузки страницы. Вот например:
1. создал php модуль adv_portal_load
PHP Code:
<tr>
    <
td class="alt1"><span class="smallfont">
        
$load<br /></span>
    </
td>
</
tr
2. подключил php файл
PHP Code:
<script type="text/javascript" src="modules/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
//More Button
$('.more').live("click",function() 
{
var ID = $(this).attr("id");
if(ID)
{
$("#more"+ID).html('<img src="modules/moreajax.gif" />');

$.ajax({
type: "POST",
url: "modules/ajax_more.php",
data: "lastmsg="+ ID, 
cache: false,
success: function(html){
$("ol#updates").append(html);
$("#more"+ID).remove();
}
});
}
else
{
$(".morebox").html('The End');

}


return false;


});
});

</script>
<style>
body
{
font-family:Arial, 'Helvetica', sans-serif;
color:#000;
font-size:15px;

}
a { text-decoration:none; color:#0066CC}
a:hover { text-decoration:underline; color:#0066cc }
*
{ margin:0px; padding:0px }
ol.timeline
    { list-style:none}ol.timeline li{ position:relative;border-bottom:1px #dedede dashed; padding:8px; }ol.timeline li:first-child{}
    .morebox
    {
    font-weight:bold;
    color:#333333;
    text-align:center;
    border:solid 1px #333333;
    padding:8px;
    margin-top:8px;
    margin-bottom:8px;
    -moz-border-radius: 6px;-webkit-border-radius: 6px;
    }
    .morebox a{ color:#333333; text-decoration:none}
    .morebox a:hover{ color:#333333; text-decoration:none}
    #container{margin-left:60px; width:580px }
    
</style>


<div id='container'>
<ol class="timeline" id="updates">
<?php
$sql 
$db->query("select * from " TABLE_PREFIX "user ORDER BY userid DESC LIMIT 5");

while(
$row=$db->fetch_array($sql))
{
$msg_id=$row['userid'];
$message .=$row['username'] . '<br /><br />';
 } 
$load '<li>' $message '</li></ol>
<div id="more' 
$msg_id '" class="morebox">
<a href="#" class="more" id="' 
$msg_id '">more</a>
</div>
</div>'
;
echo 
$load;
?>
4. подгружаемый скрипт:
PHP Code:
 <?php
/*********************/
$forumpath 'Z:/***/***/www';
if (
$forumpath)
{if (!
is_dir($forumpath)) {echo 'Указан неверный путь к форуму!'; exit;} chdir($forumpath);}
$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();
require_once(
'./includes/vba_cmps_include_template.php');
require_once(
'./global.php');
/**********************/


if(isSet($_POST['lastmsg']))
{
$lastmsg=$_POST['lastmsg'];
$result $db->query("select * from " TABLE_PREFIX "user where userid<" $lastmsg " order by userid desc limit 5");

while(
$row=$db->fetch_array($result))
{
$msg_id=$row['userid'];
$message .= $row['username'] . '<br /><br />';
}

$load '<li>' $message '</li><div id="more' $msg_id '" class="morebox">
<a href="#" id="' 
$msg_id '" class="more">more</a>
</div>'
;

echo 
$load;
}
?>
echo выводит все нормально (торчит только сверху сайта), а как вот сделать чтобы вывод значения переменной $load находился в самом модуле?
через eval не получается:
PHP Code:
eval('$home["$mods[modid]"][\'content\'] = "' fetch_template('adv_portal_load') . '";'); 
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 


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




All times are GMT +4. The time now is 02:41 AM.


Powered by vBulletin® Version 3.5.6
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Loading...