acctman
12-10-2008, 06:27 PM
1) Script Title: Script Title: Ajax Pagination script v1.2.2
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/suppliment.htm
3) Describe problem: I don't understand how to apply the php/mysql coding. is there a complete example of a php/mysql ajax demo?
this is the current query coding that i use on my edit-comments.tpl file. Basically my site runs on a smarty template type setup. its a basic query on the db and then out putting the user comments and profile image. With the ajax pagination what I dont understand is how it works the php/mysql example just shows the querying of the info it doesn't show how to display. Am I missing something, If i can see a working example then I can apply it to my coding below.
<!--[Loop Start [<%from%>,<%to%>] QUERY:SELECT rpc.com_id, rpc.com_comment, rpc.com_time, rm.m_id, rm.m_user, rm.m_date, rm.m_pass, rp.i_id FROM $picscommtable AS rpc LEFT JOIN $membtable AS rm ON rpc.com_user=rm.m_id LEFT JOIN $picstable AS rp ON (rm.m_id=rp.i_user AND rp.i_status=2) WHERE rpc.com_for=<%m_id%> ORDER BY rpc.com_time <%comment_order%>]-->
<?php $en['date'] = date(d_date_format,$en['com_time']); $en['date_y'] = date("Y", $en['m_date']); $en['date_m'] = date("m", $en['m_date']);
$result = @getimagesize("http://<%dir%>" . $en['date_y'] . "/" . $en['date_m'] . "/" . $en['m_id'] . "/imgPub/imgTmb/" . $en['m_id'] . "-" . $en['i_id'] . ".jpg");
$en['imgsize'] = "";
$en['imgpadding'] = "";
if($result) {
if($result[1] <= $result[0]) {
if(($result[1] * (62 / $result[0])) <= 52) {
$en['imgsize'] = " width=62";
$en['imgpadding'] = "style=\"padding-top: " . round((53 - ($result[1] * (62 / $result[0]))) / 2) . "px;\"";
} else {
$en['imgsize'] = " height=52";
$en['imgpadding'] = "style=\"padding-left: " . round((62 - ($result[0] * (53 / $result[1]))) / 2) . "px;\"";
}
} else {
$en['imgsize'] = " height=52";
$en['imgpadding'] = "style=\"padding-left: " . round((62 - ($result[0] * (53 / $result[1]))) / 2) . "px;\"";
}
}
?>
<? $en['c_shown'] = 1; ?>
<div class="img-comment">
<!--[If Start $en['i_id'] != '']-->
<a href="<%dir%>view/<%m_user%>.html"><img <%imgsize%> <%imgpadding%> alt=<%m_user%> src="<%dimg%><%date_y%>/<%date_m%>/<%m_id%>/imgPub/imgTmb/<%m_id%>-<%i_id%>.jpg"></a>
<!--[If Else]-->
<a title="User Deleted"><img src="<%dir%>simgs/img-7.gif"></a>
<!--[If End]-->
</div>
<? $en['date'] = date(d_date_format,$en['com_time']); ?>
<B><%date%></b><br><br><%com_comment%>
<!--[If Start $en['mpass'] == $en['mm_pass'] && $en['muser'] == $en['mm_user']]-->
<a href='<%dir%>view/<%m_user%>/delcom/<%com_id%>'><%_del_com%></a> | <a href='<%dir%>index.php?req=banned&act=save&user=<%m_user%>&sm_ban=true'><%_ban_user%> <%m_user%></a>
<Br>
<!--[If End]-->
<Br>
<!--[Loop End]-->
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/suppliment.htm
3) Describe problem: I don't understand how to apply the php/mysql coding. is there a complete example of a php/mysql ajax demo?
this is the current query coding that i use on my edit-comments.tpl file. Basically my site runs on a smarty template type setup. its a basic query on the db and then out putting the user comments and profile image. With the ajax pagination what I dont understand is how it works the php/mysql example just shows the querying of the info it doesn't show how to display. Am I missing something, If i can see a working example then I can apply it to my coding below.
<!--[Loop Start [<%from%>,<%to%>] QUERY:SELECT rpc.com_id, rpc.com_comment, rpc.com_time, rm.m_id, rm.m_user, rm.m_date, rm.m_pass, rp.i_id FROM $picscommtable AS rpc LEFT JOIN $membtable AS rm ON rpc.com_user=rm.m_id LEFT JOIN $picstable AS rp ON (rm.m_id=rp.i_user AND rp.i_status=2) WHERE rpc.com_for=<%m_id%> ORDER BY rpc.com_time <%comment_order%>]-->
<?php $en['date'] = date(d_date_format,$en['com_time']); $en['date_y'] = date("Y", $en['m_date']); $en['date_m'] = date("m", $en['m_date']);
$result = @getimagesize("http://<%dir%>" . $en['date_y'] . "/" . $en['date_m'] . "/" . $en['m_id'] . "/imgPub/imgTmb/" . $en['m_id'] . "-" . $en['i_id'] . ".jpg");
$en['imgsize'] = "";
$en['imgpadding'] = "";
if($result) {
if($result[1] <= $result[0]) {
if(($result[1] * (62 / $result[0])) <= 52) {
$en['imgsize'] = " width=62";
$en['imgpadding'] = "style=\"padding-top: " . round((53 - ($result[1] * (62 / $result[0]))) / 2) . "px;\"";
} else {
$en['imgsize'] = " height=52";
$en['imgpadding'] = "style=\"padding-left: " . round((62 - ($result[0] * (53 / $result[1]))) / 2) . "px;\"";
}
} else {
$en['imgsize'] = " height=52";
$en['imgpadding'] = "style=\"padding-left: " . round((62 - ($result[0] * (53 / $result[1]))) / 2) . "px;\"";
}
}
?>
<? $en['c_shown'] = 1; ?>
<div class="img-comment">
<!--[If Start $en['i_id'] != '']-->
<a href="<%dir%>view/<%m_user%>.html"><img <%imgsize%> <%imgpadding%> alt=<%m_user%> src="<%dimg%><%date_y%>/<%date_m%>/<%m_id%>/imgPub/imgTmb/<%m_id%>-<%i_id%>.jpg"></a>
<!--[If Else]-->
<a title="User Deleted"><img src="<%dir%>simgs/img-7.gif"></a>
<!--[If End]-->
</div>
<? $en['date'] = date(d_date_format,$en['com_time']); ?>
<B><%date%></b><br><br><%com_comment%>
<!--[If Start $en['mpass'] == $en['mm_pass'] && $en['muser'] == $en['mm_user']]-->
<a href='<%dir%>view/<%m_user%>/delcom/<%com_id%>'><%_del_com%></a> | <a href='<%dir%>index.php?req=banned&act=save&user=<%m_user%>&sm_ban=true'><%_ban_user%> <%m_user%></a>
<Br>
<!--[If End]-->
<Br>
<!--[Loop End]-->