درخواست یک کلاس

وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.

arpamonni

تازه وارد
سلام

میشه لطفا کد آخرین ارسال های تالار گفتمان رو که پرشین اسکریپت روی سایت وردپرسش گذاشته رو ارائه کنید؟؟؟

من کد خود آخرین ارسال هارو دارم

اما کلاسش رو ندارم .

این کدش


کد:
<?php
echo '<div id="MTForumBlock">
<table id="lastpost">
        <tr class="MTForumfirst">
            <td class="MTForumtitle">عنوان</td>
            <td class="MTForumanswer">پاسخ</td>
            <td class="MTForumview">بازديد</td>
            <td class="MTForumview">توسط</td>
</tr>';

## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = ""; // Change this if your MySQL database host is different.
$db_name = ""; // Change this to the name of your database.
$db_user = ""; // Change this to your database username.
$db_pw = ""; // Change this to your database password.

$forum_url = "/"; // Change this to reflect to your forum's URL.
$forum_id = ""; 
$limit = "15"; // Number of posts displayed.
$txtlimit = "100"; // This is the character limit.

#######################################

// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw) 
OR die ("Cannot connect to your database"); 
mysql_select_db($db_name) OR die("Cannot connect to your database"); 

if ($forum_id) {
    $forumid = "AND forumid=$forum_id";
}

if ($limit) {
    $limited = "LIMIT $limit";
}
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,replycount,views FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");



while($thread_get=mysql_fetch_array($thread_sql))
{
$replycount = $thread_get['replycount'];
$views = $thread_get['views'];
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid = $getp['postid'];
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);

echo "
        <div class=\"tr\">
            <div class=\"title\"><a href=\"".$forum_url."showthread.php?t=$tid&p=$pid\" target=\"_blank\">$title</a></div>
            <div class=\"reply\">$replycount</div>
            <div class=\"views\">$views</div>
             <div class=\"author\">$poster</div>
        </div>";


}

echo "        </tr>
    </table>
</div>";


?>
همین رو مثلا بهش کلاس بدید بذارید تا من هم استفاده کنم .دقیقا مثل پرشین اسکریت.همون دقیقا

ممنون

 

iReza

کاربر عضو
سلام.

ببخشید بش کلاس بدیم؟یا اینکه کلاسش کنیم؟متوجه نمیشم.

خوب شما طرح (Cssm,Html) رو که دارید،اگر منظورتون اینه،خوب کد PHP رو درون یک تابع قرار بدید،مثلا تابع LatestForum بعدش فراخونیش کنید،توی چرخه While میتونید اینکارو بکنید.

 

arpamonni

تازه وارد
:دی

آدم خلق کردن راحت تر از اینی بود شما فرمودی

اگر امکانش هست شما کلاسش رو بنویس بده من فق کپی کنم توی قالب اجرا شه دقیقا اون شکلی

آخه این که الان من کد رو گذاشتم رو که کپی کنی آخرین ارسال هارو میاره اما زیر هم و زشت

میخاوم دقیقا با کلاس پرشین اسکریپت بیاره

 

arpamonni

تازه وارد
به عکس نگاه کنید

یه مربع سیاه یه جا کشیدم

من هم توی سایتم همون قدر یه قسمت دارم

همون اندازه ساختم که از این کد استفاهد کنم

میخوام یه کد بدید که دقیقا همون شکلی و همون اندازه همون تعداد آخرین ارسال انجمنم رو نشون بده

You must be registered for see images attach


 

arpamonni

تازه وارد
ببین دوست عزیز

خود پرشین اسکریپت اینجوریه کد آخرین ارسال هاش


کد:
<div id="container-5">
    <ul class="tabs-nav">
        <li class="tabs-selected"><a href="#fragment-1"><span>آخرین های تالار گفتمان</span></a></li>
        <li><a href="#fragment-2"><span>آخرین پروژه ها</span></a></li>
        <!--<li><a href="#fragment-3"><span>لینکدونی ما</span></a></li>
-->
    </ul>

    <div id="fragment-1" class="noticeli tabs-container">
        <div class="table">

            <div class="th">
                <div class="title">عنوان</div>
                <div class="reply">پاسخ ها</div>
                <div class="author">توسط</div>
            </div>


<div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=4099&p=40400" target="_blank">افزونه All in One SEO Pack 1.6.13.1</a></div>
                <div class="reply">17</div>
                <div class="author">kasraa</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8136&p=40398" target="_blank">سنگینی افزونه wp-postviews</a></div>
                <div class="reply">1</div>
                <div class="author">rocki3oy</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8139&p=40397" target="_blank">راهنمایی در مورد تبلیغ آدرس سایت در بن�</a></div>
                <div class="reply">0</div>
                <div class="author">mrs1993</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8134&p=40396" target="_blank">اسكريپت انتقال دهنده لينك فامو</a></div>
                <div class="reply">2</div>
                <div class="author">Majid_one</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=1361&p=40395" target="_blank">WHMCS نسخه 3.8.1 فارسی</a></div>
                <div class="reply">100</div>
                <div class="author">mostafa98</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8133&p=40394" target="_blank">درخواست یک کلاس</a></div>
                <div class="reply">4</div>
                <div class="author">arpamonni</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8085&p=40393" target="_blank">نسخه ی 3.0.0 انجمن ساز پاور بولتین بورد</a></div>
                <div class="reply">4</div>
                <div class="author">mostafa98</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8132&p=40392" target="_blank">اسلایدر</a></div>
                <div class="reply">2</div>
                <div class="author">AHK95</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8138&p=40389" target="_blank">ایران و ایرانی در php</a></div>
                <div class="reply">0</div>
                <div class="author">Z.3.R.0</div>
            </div><div class="tr">
                <div class="title"><a href="http://forum.persianscript.ir/showthread.php?t=8137&p=40388" target="_blank">مشکل تابع _check_active_widget</a></div>
                <div class="reply">0</div>
                <div class="author">a--m--j</div>
            </div>            
         </div><!--Table-->
    </div><!--Fragment 1-->
خوب این حاصل یک کد نمایش آخرین ارسال + یه سری کلاس هستش

من هر دوی اینهارو دارم

این خود کد نمایش آخرین ارسال


کد:
<?php
echo '<div id="MTForumBlock">
<table id="lastpost">
        <tr class="MTForumfirst">
            <td class="MTForumtitle">عنوان</td>
            <td class="MTForumanswer">پاسخ</td>
            <td class="MTForumview">بازديد</td>
            <td class="MTForumview">توسط</td>
</tr>';

## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = ""; // Change this if your MySQL database host is different.
$db_name = ""; // Change this to the name of your database.
$db_user = ""; // Change this to your database username.
$db_pw = ""; // Change this to your database password.

$forum_url = "/"; // Change this to reflect to your forum's URL.
$forum_id = ""; 
$limit = "15"; // Number of posts displayed.
$txtlimit = "100"; // This is the character limit.

#######################################

// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw) 
OR die ("Cannot connect to your database"); 
mysql_select_db($db_name) OR die("Cannot connect to your database"); 

if ($forum_id) {
    $forumid = "AND forumid=$forum_id";
}

if ($limit) {
    $limited = "LIMIT $limit";
}
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,replycount,views FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");



while($thread_get=mysql_fetch_array($thread_sql))
{
$replycount = $thread_get['replycount'];
$views = $thread_get['views'];
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid = $getp['postid'];
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);

echo "
        <div class=\"tr\">
            <div class=\"title\"><a href=\"".$forum_url."showthread.php?t=$tid&p=$pid\" target=\"_blank\">$title</a></div>
            <div class=\"reply\">$replycount</div>
            <div class=\"views\">$views</div>
             <div class=\"author\">$poster</div>
        </div>";


}

echo "        </tr>
    </table>
</div>";


?>
اینم کلاسش


کد:
/* Caution! Ensure accessibility in print and other media types... */
@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
    .tabs-hide {
        display: none;
    }
}

/* Hide useless elements in print layouts... */
@media print {
    .tabs-nav {
        display: none;
    }
}

/* Skin */
.tabs-nav {
    list-style: none;
    width:357px;
    height:44px;
    background:url(../images/tabs-nav.jpg) no-repeat top;
    float:right;
    padding:0 27px 0 0;
    position:absolute;
    top:0;
    left:-5px;
}
.tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
    display: block;
    clear: both;
    content: " ";
}
.tabs-nav li {
    float: right;
    margin: 0 2px 0 1px;
    height:44px;
    background:url(../images/tab-nav-li.jpg) no-repeat left;
    padding:0 0 0 5px
}
.tabs-nav a, .tabs-nav a span {
    display: block;
    padding: 0 5px;
    font-family:Tahoma, Geneva, sans-serif;
    font-size:11px;
    color:#fff;
    text-shadow:1px 1px #868686
}
.tabs-nav a {
    position: relative;
    z-index: 2;
    color: #27537a;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap; /* required in IE 6 */    
}
.tabs-nav .tabs-selected a {
    background:url(../images/tab-nav-a.jpg) repeat-x !important;
    height:44px;
    float:right;
    margin:0;
}

.tabs-nav a span {
    width: 64px; /* IE 6 treats width as min-width */
    min-width: 64px;
    height:44px; /* IE 6 treats height as min-height */
    min-height: 18px;
    padding-top: 6px;
    padding-right: 0;
}
.tabs-nav .tabs-selected a span {
    background:url(../images/tab-nav-span.jpg) no-repeat 95% 34px !important;
    color:#505050 !important;
    text-shadow:1px 1px #fff !important
}
*>.tabs-nav a span { /* hide from IE 6 */
    width: auto;
    height: 44px;
}

.tabs-nav .tabs-selected a:link, .tabs-nav .tabs-selected a:visited, .tabs-nav .tabs-disabled a:link, .tabs-nav .tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
    cursor: text;
}
.tabs-nav a:hover, .tabs-nav a:focus, .tabs-nav a:active { /* @ Opera, we need to be explicit again here now... */
    cursor: pointer;
}
.tabs-nav .tabs-disabled {
    opacity: .4;
}
.tabs-container {
    float:right;
    margin:50px 5px 0 0;
    width:361px
}
.tabs-loading em {
    padding: 0 0 0 20px;
    background: url(../images/loading.gif) no-repeat 0 50%;
}
فقط نمیتونم بهش کلاس رو بدم که اونجوری نمایش پیدا کنه

همین

دیگه چی بگم؟؟؟

 
وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.
بالا