Help
Search
Login
Register
Home
Forum: web design and graphics community
Celestial Star Forum
>
Web Development
>
Coding
>
Comments in db
Pages: [
1
]
« previous
next »
Print
Author
Topic: Comments in db (Read 918 times)
silentstorm
Angeling
Posts: 2
Comments in db
«
on:
October 15, 2005, 03:41:52 PM »
I want to know if their is a way to let people leave comments on my graphics and layouts, I have been everywhere but their is no tutorial or downloadable thing for it. This is my layouts.php coding if you know how can you please help.
Code:
<? include("header.php"); ?>
<td valign="top" align="center">
<?php
include &
#40;'connection.php');
$displayGroup
=
5
;
if &
#40;$_GET['group']) {
$displayGroup
=
$_GET
[
'group'
&
#93;;
&
#125;
$page
=
0
;
if &
#40;$_GET['screen']) {
$page
=
$_GET
[
'screen'
&
#93;;
&
#125;
$firstRow
=
$page
*
$displayGroup
;
$lastRow
=
$firstRow
+
$displayGroup
;
$currentRow
=
0
;
$totalRows
=
0
;
$numberDisplayed
=
0
;
$result
=
mysql_query
&
#40;"select * from layouts where type='$type' order by added desc");
if &
#40;!$result) {
echo
"<p>There is no data available!</p>"
;
return;
&
#125;
while&
#40; $r=mysql_fetch_array ($result))
&
#123;
$totalRows
++;
if &
#40; ($numberDisplayed <= $displayGroup) &&
&
#40;$currentRow >= $firstRow) &&
&
#40;$currentRow < $lastRow))
&
#123;
$numberDisplayed
++;
$id
=
$r
[
"id"
&
#93;;
$title
=
$r
[
"title"
&
#93;;
$artist
=
$r
[
"artist"
&
#93;;
$added
=
$r
[
"added"
&
#93;;
$type
=
$r
[
"type"
&
#93;;
$img
=
$r
[
"img"
&
#93;;
$preview
=
$r
[
"preview"
&
#93;;
$download
=
$r
[
"download"
&
#93;;
$dcounter
=
$r
[
"dcounter"
&
#93;;
$pcounter
=
$r
[
"pcounter"
&
#93;;
echo
"
<table width=\"260\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\">
<tr>
<td class=\"head\" width=\"260\" height=\"10\">>> $title <<</td><p>
</tr>
<td style=\"border: #744C7D; border-style: dotted; border-width: 1px;\" width=\"260\" bgcolor=\"#21BEDF\" bordercolor=\"#744C7D\">
<img src=\"$img\" align=\"left\">
ID: $id<BR>
Title: $title<BR>
Artist: $artist<BR>
Added: $added<BR>
Type: $type<BR>
Previewed: $pcounter<BR>
Downloaded: $dcounter<BR>
</td>
<p>
</tr>
<tr>
<td class=\"head\" width=\"260\" height=\"10\">
<a href=\"design.php?do=preview&id=$id\">Preview</a> |
<a href=\"design.php?do=download&id=$id\">Download</a>
</td>
</tr>
</table>
<br>"
;
&
#125;
$currentRow
++;
&
#125;
echo
"<div align=\"center\">"
;
$separator
=
""
;
if &
#40;$page > 0) {
$prev
=
$page
-
1
;
$url
=
"index.php?link=layouts&type=$type&screen=$prev"
;
echo
"<a href=\"$url\">Previous</a>"
;
$separator
=
" | "
;
&
#125;
$pageNum
=
1
;
$row
=
0
;
while &
#40;$row < $totalRows) {
$screenNum
=
$pageNum
-
1
;
$url
=
"index.php?link=layouts&type=$type&screen=$screenNum"
;
echo
"$separator"
;
if &
#40;$screenNum == $page)
echo
"<b>$pageNum</b>"
;
else
echo
"<a href=\"$url\">$pageNum</a>"
;
$separator
=
" | "
;
$row
=
$row
+
$displayGroup
;
$pageNum
++;
&
#125;
$next
=
$page
+
1
;
if &
#40;($next * $displayGroup) < $totalRows) {
$url
=
"$PHP_SELF?screen=$next"
;
echo
"$separator<a href=\"$url\">Next</a>"
;
&
#125;
echo
"</div>"
;
?>
</td>
<? include("footer.php"); ?>
[/code]
Logged
puretaurus21
Guest
Comments in db
«
Reply #1 on:
October 20, 2005, 06:57:24 AM »
Well its very easy. Just get the DDG code for the blog and incorporate it to your system. Its as easy as pie. I even have it in my site. Go try it first and if you get stuck come to us. =)
Logged
silentstorm
Angeling
Posts: 2
Comments in db
«
Reply #2 on:
October 23, 2005, 02:48:24 PM »
I can't figure it out at all, is their any way you can help me get started.
Logged
puretaurus21
Guest
Comments in db
«
Reply #3 on:
November 21, 2005, 09:34:39 PM »
Well first of all, you just need a single database for your comments only.
http://www.daydreamgraphics.com/d/tutorial/list/81/2
Like what it is seen on this page, just convert everything like the name of the files into designcomments.php something like that. Then put it on your code, like so:
Code:
echo "
<table width=\"260\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\">
<tr>
<td class=\"head\" width=\"260\" height=\"10\">>> $title <<</td><p>
</tr>
<td style=\"border: #744C7D; border-style: dotted; border-width: 1px;\" width=\"260\" bgcolor=\"#21BEDF\" bordercolor=\"#744C7D\">
<img src=\"$img\" align=\"left\">
ID: $id<BR>
Title: $title<BR>
Artist: $artist<BR>
Added: $added<BR>
Type: $type<BR>
Previewed: $pcounter<BR>
Downloaded: $dcounter<BR>
<a href=\"designcomments.php?id=$id\">Comment?</a>.
</td>
<p>
</tr>
<tr>
<td class=\"head\" width=\"260\" height=\"10\">
<a href=\"design.php?do=preview&id=$id\">Preview</a> |
<a href=\"design.php?do=download&id=$id\">Download</a>
</td>
</tr>
</table>
<br>";
Just try that and if you get stuck post it here and I'll help you. I'll help you show how many people commented after you have done that task.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General
=> New Members
=> Announcements
=> Support / Suggestions
-----------------------------
Contests
-----------------------------
=> Archive
===> Contests
===> Blend Challenges
===> SOTW
-----------------------------
Art Boards
-----------------------------
=> Creative mediums
=> Requests & offers
=> Tutorials
===> Celestial Star Tutorials
-----------------------------
Web Development
-----------------------------
=> Coding
=> Web Design
=> Advertisements / Affiliation
-----------------------------
Off-topic
-----------------------------
=> Entertainment
-----------------------------
Español (Spanish Only)
-----------------------------
=> General / Bienvenida
=> Anuncios / Ayuda
=> Código / Desarrollo web
Welcome,
Guest
Members login
Register for free
General
General
New members
Announcements
Support / Suggestions
Art boards
Creative mediums
Requests and offers
Tutorials
Celestial Star tutorials
Web development
Coding
Web design
Advertisements / affiliation
Off-topic
The non-sense
Ertentainment
Loading...