• Help
  • Search
  • Login
  • Register
  • Home

Forum: web design and graphics community

  Show Posts
Pages: 1 ... 9 10 [11]
151  Web Development / Coding / Re: Search Engine: Expand Search Option on: November 18, 2007, 07:03:18 PM
I hope this is my last (and possibly hardest) question to ask.  I have created a layouts search engine which, when the search is compiled and the results are shown, allows the searcher to click on the image and redirect them to the page of the layouts, as seen here.

However, the layouts pages are connected to a php page which allows only a certain number of layouts per page and then creates new pages when the current ones are filled.

My question, in a nutshell, is how can I link the searched images to these pages which are created through php?

Here is the search engine code:

Quote
<center><form action="#results" method="post">
Type: <input type="text" name="type" size="30" maxlength="30"></p>

<p>Series: <select name="series">
<?php
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

// List out the series in the database
$qSeries = "select series_id, series_name from layseries order by series_name ";
$rsSeries = mysql_query($qSeries) or die ('Cannot execute query');

while ($row = mysql_fetch_array($rsSeries))
{
extract($row);
echo '<option value="'.$series_id.'">'.$series_name.'></option>';

}
?>
</select>
</p>
<p><input type="submit" value="Search"></p>
</form></center>

<hr>

<p>Here are the <a name="results">results</A> of your search:


<p><?php
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

// For global registers off
// ====================
$type = strtolower(strip_tags(mysql_escape_string($_POST['type'])));
$series = strip_tags(mysql_escape_string($_POST['series']));
$order = strip_tags(mysql_escape_string($_POST['order']));

// validate for empty type field
// Remove this if you wish to allow all type listing
if (empty($type))
{
die ('Please fill in a layout option.');
}

// Build search query
$qSearch = "select a.*, b.series_name from layouts a, layseries b where a.type LIKE '%$type%' and a.series_id='$series' and a.series_id=b.series_id order by a.date $order ";
$rsSearch = mysql_query($qSearch);

if (mysql_num_rows($rsSearch) == 0)
{
print '<p>Sorry, there was no results returned for your search. Please try again.</p>';
}
else
{
print '<p><strong>'.mysql_num_rows($rsSearch).'</strong> layout(s) found.</p>';

while ($row = mysql_fetch_array($rsSearch))
{
extract($row);

print '<table border="0" align="center" valign="top" cellpadding="7" cellspacing="2"><td>

<table bgcolor="#ADC6BC" style="border: 1px solid #000;"><tr>

<td><a href="'.$layout_url.'"><img src="http://i182.photobucket.com/albums/x165/Mind8/'.$layout_image.'" border="0" title="Layout" alt="Layout"></A></td>

<td style="border-left: 1px dotted #000; padding-left: 4px;">
<b>Title:</b>
<br><div class="indent">'.$layout_title.'</div>
<b>Series:</b>
<br><div class="indent">'.$series_name.'</div>
<b>Character(s):</b>
<br><div class="indent">'.$character.'</div>
<b>Type:</b>
<br><div class="indent">'.$type.'</div>
<b>Added:</b>
<br><div class="indent">'.$date.'</div>
</td>

</tr></table>

</td></table>';

}
}
?>

And here is the code for one of the pages I am trying to connect to (sorry if it's a complete mess):

Quote
<?php

$dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("databasename");

$query = "select * from dlayouts order by layout_id desc ";
 $result = mysql_query($query);

// Insert Code A Here

// dynamic navigation variables
$screen = $_GET['screen'];
$PHP_SELF = $_SERVER['PHP_SELF'];

$rows_per_page=5;
$total_records=mysql_num_rows($result);
$pages = ceil($total_records / $rows_per_page);

if (!isset($screen))
$screen=0;
$start = $screen * $rows_per_page;
$query .= "LIMIT $start, $rows_per_page";
$result= mysql_query($query) or die
("Could not execute query : $query." . mysql_error());

$i=0; // set the column indicator
echo '<table border="0" align="center" valign="top" cellpadding="7" cellspacing="2">'; // open table tag here

while($row=mysql_fetch_array($result))
{
extract($row); // extract row values

$layout_url=$row["layout_url"];
$layout_name=$row["layout_name"];
$layout_image=$row["layout_image"];
$category=$row["category"];
$characters=$row["characters"];
$date=$row["date"];
$count_display=$row["count_display"];
$name_url=$row["name_url"];

if ($i==0)
{
echo "<tr><td>
<table align=\"center\">
<a name=\"$name_url\"></A>
<tr><td colspan=\"2\" class=\"name\">$layout_name</td>
<tr><td><table bgcolor=\"#ADC6BC\" style=\"border: 1px solid #000;\">
<tr><td>
<a href=\"graphics/$layout_url\" target=\"_blank\"><img src=\"http://i182.photobucket.com/albums/x165/Mind8/$layout_image\" border=\"0\" title=\"Layout\" alt=\"Layout\" /></A></td>
<td height=\"100\" width=\"140\" style=\"border-left: 1px dotted #000; padding-left: 4px;\">
<b>Series:</b><br /><div class=\"indent\">$category</div>
<b>Character(s):</b><br /><div class=\"indent\">$characters</div>
<b>Added:</b><br /><div class=\"indent\">$date</div>
</td></tr>
<tr><td colspan=\"2\" align=\"center\">[<a href=\"graphics/$layout_url\" target=\"_blank\">Preview</A>] [<a href=\"$layout_dl\" target=\"_blank\">Download</A> ($count_display)]</td></tr>
</table></table>
</td>";
}

}
echo '</table>'; // close table

// Put Code C Here

        // create the dynamic links
        if ($screen > 0) {
        $j = $screen - 1;
        $url = "$PHP_SELF?screen=$j";
        echo "<a href=\"$url\">&laquo; Previous</a> | ";    // I replaced the Prev with the &laquo; which is <<
        }
       
        // page numbering links now
        $p = 5;                                // number of links to display per page
        $lower = $p;                    // set the lower limit to $p
        $upper = $screen+$p;        // set the upper limit to current page + number of links per page
        while($upper>$pages){
            $p = $p-1;
            $upper = $screen+$p;
        }
        if($p<$lower){
            $y = $lower-$p;
            $to = $screen-$y;
            while($to<0){
                $to++;
            }
        }
       
        if(!empty($to))
        {
            for ($i=$to;$i<$screen;$i++){
                $url = "$PHP_SELF?screen=" . $i;
                $j = $i + 1;
                echo " <a href=\"$url\">[$j]</a> | ";
            }
        }
       
        for ($i=$screen;$i<$upper;$i++) {
            $url = "$PHP_SELF?screen=" . $i;
            $j = $i + 1;
            echo " <a href=\"$url\">[$j]</a>  | ";
        }
       
        if ($screen < $pages-1) {
        $j = $screen + 1;
        $url = "$PHP_SELF?screen=$j";
        echo "<a href=\"$url\">Next &raquo;</a>";   // I replaced the Next with the &raquo; which is >>
        }
        ?>

If anyone can figure it out, I bow down to your php skills and will be very grateful for the help.
152  Web Development / Coding / Re: Search Engine: Expand Search Option on: November 18, 2007, 05:13:59 PM
Thank you so much for the help, your code worked perfectly.  I don't mind the lesson or the clean up with the code, because I'm still an infant when it comes to doing both.  Your lessons are really helping me to understand what php coding is all about!

Thanks again!
153  Web Development / Advertisements / Affiliation / Re: Insane Mind - Fanfiction/Graphics on: November 18, 2007, 03:11:25 PM
The updates area?  I use the script called cutenews from cutephp (the easy way to go for those not skilled with php).
154  Web Development / Coding / Re: Search Engine: Expand Search Option on: November 18, 2007, 03:10:38 PM
Hi again.  The php newbie has returned bearing another question...and a cookie for anyone who has the answer.  I have created an avatar search engine using the script above, but how can I order the images so when the results are given there are two columns of avatars (as seen here in my gallery)?

Here's the code:

Quote
<center><form action="#results" method="post">
Size: <input type="text" name="size" size="30" maxlength="30"></p>

<p>Series: <select name="series">
<?php
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

// List out the series in the database
$qSeries = "select series_id, series_name from avseries order by series_name ";
$rsSeries = mysql_query($qSeries) or die ('Cannot execute query');

while ($row = mysql_fetch_array($rsSeries))
{
extract($row);
echo '<option value="'.$series_id.'">'.$series_name.'></option>';

}
?>
</select>
</p>
<p><input type="submit" value="Search"></p>
</form></center>

<hr>

<p>Here are the <a name="results">results</A> of your search:


<p><?php
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

// For global registers off
// ====================
$size = strtolower(strip_tags(mysql_escape_string($_POST['size'])));
$series = strip_tags(mysql_escape_string($_POST['series']));
$order = strip_tags(mysql_escape_string($_POST['order']));

// validate for empty size field
// Remove this if you wish to allow all size listing
if (empty($size))
{
die ('Please fill in an avatar size.');
}

// Build search query
$qSearch = "select a.*, b.series_name from avatars a, avseries b where a.size LIKE '%$size%' and a.series_id='$series' and a.series_id=b.series_id order by a.date $order ";
$rsSearch = mysql_query($qSearch);

if (mysql_num_rows($rsSearch) == 0)
{
print '<p>Sorry, there was no results returned for your search. Please try again.</p>';
}
else
{
print '<p><strong>'.mysql_num_rows($rsSearch).'</strong> avatar(s) found.</p>';

while ($row = mysql_fetch_array($rsSearch))
{
extract($row);

print '<table border="0" align="center" valign="top" cellpadding="7" cellspacing="2">
<tr><td><table bgcolor="#ADC6BC" style="border: 1px solid #000;">
<tr><td height="100">
<img src="'.$avatar_url.'" border="0" title="Avatar" alt="Avatar"></td>
<td height="100" width="100" style="border-left: 1px dotted #000; padding-left: 4px;">
<b>Series:</b>
<br><div class="indent">'.$series_name.'</div>
<b>Size:</b>
<br><div class="indent">'.$size.'</div>
<b>Added:</b>
<br><div class="indent">'.$date.'</div>
</td></table></table>';

}
}
?>

Thanks in advance for the help!
155  Web Development / Coding / Re: Search Engine: Expand Search Option on: November 18, 2007, 10:50:04 AM
It worked like a charm!  Thanks so much for the help, and especially for explaining about the percentage!
156  Web Development / Advertisements / Affiliation / Animara.org - animanga fansite on: November 17, 2007, 10:57:21 PM
Hey all, just wanted to get some feedback (positive, negative, or neutral wanted) about my site:

Animara.org

The site is focused on both anime/manga fanfiction and graphics, with an emphasis on easy navigation and a simple but elegant design.  The content, as mentioned, consists of graphics (layouts, avatars, & signatures) along with personally written fanfiction stories across eight different anime/manga.

I'll take any feedback anyone has to offer concerning anything on the site, whether it be content, style, or simply a personal annoyance someone has with any part of the site.
157  Web Development / Coding / [solved]Search Engine: Expand Search Option on: November 17, 2007, 08:16:51 PM
I acquired a search engine code from DDG and have found one small problem when searching.  If anyone were to look for a title of a story, they are required to type the first letter of the story title, but nothing after that will show.  For example, if I were to have a story called Hell Fire, I would be required to type in "Hell" to find the story, but typing in "Fire" wouldn't find the story.

Here is the code for the engine:

Quote
<center><form action="Search.php#results" method="post">
Title: <input type="text" name="story_title" size="30" maxlength="30"></p>

<p>Series: <select name="series">
<?php
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

// List out the series in the database
$qSeries = "select series_id, series_name from series order by series_name ";
$rsSeries = mysql_query($qSeries) or die ('Cannot execute query');

while ($row = mysql_fetch_array($rsSeries))
{
extract($row);
echo '<option value="'.$series_id.'">'.$series_name.'></option>';

}
?>
</select>
</p>
<p><input type="submit" value="Search"></p>
</form></center>

<hr>

<p>Here are the <a name="results">results</A> of your search:


<p><?php
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

// For global registers off
// ====================
$story_title = strtolower(strip_tags(mysql_escape_string($_POST['story_title'])));
$series = strip_tags(mysql_escape_string($_POST['series']));
$order = strip_tags(mysql_escape_string($_POST['order']));

// validate for empty story_title field
// Remove this if you wish to allow all story_title listing
if (empty($story_title))
{
die ('Please fill in a story title.');
}

// Build search query
$qSearch = "select a.*, b.series_name from stories a, series b where a.story_title LIKE '$story_title%' and a.series_id='$series' and a.series_id=b.series_id order by a.id $order ";
$rsSearch = mysql_query($qSearch);

if (mysql_num_rows($rsSearch) == 0)
{
print '<p>Sorry, there was no results returned for your search. Please try again.</p>';
}
else
{
print '<p><strong>'.mysql_num_rows($rsSearch).'</strong> story(s) found.</p>';

while ($row = mysql_fetch_array($rsSearch))
{
extract($row);

print '<p><strong>Title:</strong> <a href="'.$story_url.'" >'.$story_title.'</A> <br /> <strong>Series:</strong> <a href="'.$series_url.'" >'.$series_name.'</A> <br /> <strong>Rating:</strong> '.$rating.' <br /> <strong>Genre:</strong> '.$genre.' <br /> <strong>Universe:</strong> '.$universe.' <br /> <strong>Status:</strong> '.$status.' <br /> <strong>Chapter(s):</strong> '.$chapter.' </p>';

}
}
?>

Is there any way I can change the code so the search isn't so specific for the story titles?  Thanks for the help in advance.
158  Web Development / Coding / Re: Multiple Columns For Database on: November 16, 2007, 10:41:46 AM
It worked great!  Thanks for the help!

(Note: highly edited from first two postings.)
159  Web Development / Coding / [solved]Multiple Columns For Database on: November 15, 2007, 07:39:45 PM
I am currently experimenting with using an avatar database and have hit a snag with  some coding.  I copied the code for the php from here and modified the table slightly, and for some reason the avatars are displaying in a single row seen here rather than the double column I want.

The original code, without my changes, also displays the same single-row problem.  Here is my modified code:

Quote
<?php

$dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("my_avatars");

$query = "select * from avatars order by avatar_url desc ";;
$result = mysql_query($query);

$divide=0; // Initial divider is zero
?>

<table align="center" border="0" cellpadding="7" cellspacing="3">
<tr>

<?php
while($row=mysql_fetch_array($result))
{

// Here's where we tell the script to limit the columns to a certain number
if($divide%2==0 && $divide!=0){
echo "</tr><tr>";
}

extract($row); // extract row values

// now let's format how the avatars will be displayed
?>

<td>
<table bgcolor="#ADC6BC" style="border: 1px solid #000;">
<tr>
<td><img src="<?php echo $avatar_url; ?>" border="0" alt="Avatar"><br clear="all"/></td>
<td>
<b>Series:</b>
<br><div class="indent"><?php echo $category; ?></div>
<b>Size:</b>
<br><div class="indent"><?php echo $size; ?></div>
<b>Added:</b>
<br><div class="indent"><?php echo $date; ?></div>
</td>
</tr></table></td>

<?php
} // end of while statement
?>
</tr>
</table>

Do I need to change a part of the php code to get the rows to create two columns?
160  Web Development / Coding / Re: How To Make An Avatar Database Gallery? on: November 15, 2007, 02:30:25 PM
The site has several posts on the subject.  Simply type in the words "avatar" and "database" into the forum search.

One of the more useful finds are here and here.
161  Web Development / Coding / Re: Repeat Background In Div Layout Not Showing on: November 12, 2007, 01:11:22 AM
The width: 100% only allowed the height of the background to reach to the bottom of the screen.  Thanks for the help, but since this is such a pain I changed the layout rather than screw with the coding.
162  Web Development / Coding / Re: Repeat Background In Div Layout Not Showing on: November 10, 2007, 01:43:04 PM
The <div class="center"> at the top of the index page holds the repeating background for the div.
163  Web Development / Coding / Re: Repeat Background In Div Layout Not Showing on: November 10, 2007, 11:01:12 AM
No, I'm afraid that didn't work.  Thanks for the help, though.
164  Web Development / Coding / [solved]Repeat Background In Div Layout Not Showing on: November 09, 2007, 08:24:43 PM
Currently I'm trying to code a centered div layout which requires a repeating background in the main div.  The image repeats fine in Internet Explorer, but refuses to repeat in Firefox and Seamonkey unless I give the image a set height.

Here is the layout.

Here is the html coding (the content has been simplified from the page, but no coding has been removed):
Quote
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

<TITLE>Your Site Name | ver. ?? Taken Away...</TITLE>
</head>
<body>

<div class="center">

<div class="bg"></div>
<div class="bg1">

<!-- START OF NAVIGATION  -->

<div id="div1">
<div class="font">Header</div>

&sect; <a href="">Link Here</A><br>
&sect; <a href="">Link Here</A><br>
&sect; <a href="">Link Here</A><br>
&sect; <a href="">Link Here</A><br>

<div class="font">Header</div>

&sect; <a href="">Link Here</A><br>
&sect; <a href="">Link Here</A><br>
&sect; <a href="">Link Here</A><br>
&sect; <a href="">Link Here</A><br>

<!-- DO NOT REMOVE -->

<div class="font">Credits</div>

<center>
Site &copy Your name
<br>Layout: <a href="http://animara.org/" target="_blank">Insane Mind</A>
</center>

<!-- DO NOT REMOVE -->

</div>

<!-- END OF NAVIGATION -->

<!-- START OF CONTENT -->

<div align="center">
<div id="div">

<div class="font">Header</div>

A layout.

</div></div>

<!-- END OF CONTENT  -->

</div></div></div>

</body></html>

And here is the css coding:
Quote
BODY { margin: 0px;
color: #CAD6D2;
font-family: times new roman, arial, verdana, sans-serif;
font-size: 12px;
background: url(images/BG.jpg) top center repeat;
text-align: center; }

a:visited { color: #748180;
text-decoration: none;
cursor: crosshair; }

a:link { color: #FFFDF2;
text-decoration: none;
cursor: crosshair; }

a:hover { color: #731829;
text-decoration: none;
cursor: crosshair; }

div.center { margin: 0px auto;
text-align: center;
width: 673px;
background: url('images/Repeat.jpg') top center repeat-y; }

div.bg { padding-bottom: 0px;
background: url(images/H.jpg) top center no-repeat;
width: 673px;
height: 130px; }

div.bg1 { padding-bottom: 0px;
background: url(images/H1.jpg) top center no-repeat;
width: 673px;
height: 394px; }

#div { margin: 0px auto;
margin-right: 55px;
width: 380px;
float: right;
padding-top: 300px;
padding-bottom: 8px;
text-align: left; }

#div1 { margin: 0px auto; 
margin-left: 50px;
float: left;
width: 150px;
padding-bottom: 8px;
text-align: left; }

div.font { color: #fff;
font-family: times new roman, verdana, sans-serif;
font-size: 20px;
text-align: center;
margin-top: 10px;
margin-bottom: 5px;
border-bottom: 1px solid #859F9F; }

div.font:first-letter { font-weight: bold;
font-style: italic;
text-transform: none; }

Any suggestions on how I can get Firefox and Seamonkey to recognize the repeating image?
165  General / New Members / Hello Design World on: October 10, 2007, 12:39:35 AM
A relative newcomer to the graphics world with a decent start on design, I've joined the group at Celestial Star to learn some new tricks taught by the old dogs.

Oh, and the Hello Kitty emoticons scare me.
Pages: 1 ... 9 10 [11]
  • 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
  • Ententainment

Go up
eXTReMe Tracker
  • Valid XHTML
  • Valid CSS
Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC | Seo4Smf v0.2 © Webmaster's Talks
Loading...