PDA

View Full Version : Recently Uploaded


Gashu
11-13-2011, 05:15 PM
I have a suggestion/request :D

It would be great if there were, on the homepage, a "recently uploaded pets" or "newest pets", like at the bottom of this site: http://www.icepets.com/homepage.php. Also, this would work well if there were items. Just something interesting to add to the front page :D

mapleblade
11-14-2011, 12:52 AM
you can do this with a simple mysql query, but i cant make it atm because i gotta go to school ;l

Gashu
11-14-2011, 01:03 AM
Aww wow really? I'm not too good with coding haha xD I've started using MyAdopts for a bit because it's a bit simpler haha, would the code be the same for that site?

mapleblade
11-14-2011, 05:36 AM
try something like this:

$query = "SELECT * FROM {$prefix}adoptables ORDER BY id DESC LIMIT 5";
$result = runquery($query);
$row = mysql_fetch_array($result);

$image = getcurrentimage($row['id']);

article_content .= '<img src="{$image}" /><br /><b>{$row['type']}</b>';

Gashu
11-14-2011, 06:41 AM
Oh awesome, thanks so much! I'll try that soon then, MyAdopts seems to be down right now though :O I'll message back once I've tried it :D

SilverDragonTears
11-14-2011, 12:12 PM
I could be wrong, but I don't think this will work on a MyAdopts site.

Gashu
11-14-2011, 12:28 PM
Okay, I figured out how to make the themes work on Mysidia so I'm going to use this instead (and Myadopts still isn't up lol). Where exactly do I need to put this code? :P

SilverDragonTears
11-14-2011, 12:34 PM
You want it to show on the index page right?

Gashu
11-14-2011, 12:42 PM
Yup :D At the bottom of the index page :)

SilverDragonTears
11-14-2011, 12:48 PM
What is your address?

Gashu
11-14-2011, 12:52 PM
My address? As in, website URL right? :P Here it is: http://albasia.elementfx.com/index.php
I was thinking it could go under the text, but over the big picture at the bottom?

SilverDragonTears
11-14-2011, 01:22 PM
Hmmm.... can I see the script to the page where all your stuff for the front page is on? (I do my site a little different than most) BTW... your site looks great!

Gashu
11-14-2011, 01:31 PM
Sure! And thanks! :D I just checked out your site, that looks awesome too! I couldn't figure out how to make custom nav buttons, because when I changed to the admin panel, the buttons would change and I couldn't work out how to make the custom buttons change with it :P

Okay, I have this one:

/*
Theme Name: Ginger Ninja! v2
Description: The new Ginger Ninja! theme.
Version: 1.0
Author: Donny Burnside
Author URI: http://www.ginger-ninja.net/
*/

/* Generic Styling */

body {
background:url(http://fc04.deviantart.net/fs71/f/2011/317/d/e/backgroundtop_by_gashu_monsata-d4g4f45.png) repeat-x top center fixed #61d7d6;
font-family:"Trebuchet MS" Arial, Helvetica, sans-serif;
font-size:62.5%; /* Sets default font size to 10px */
color:#222222;
}

* {
margin:0;
padding:0;
}

img {
border:0;
}

p {
margin-bottom:1.75em;
}

a {
text-decoration:none;
color:#B4C835;
}
a:hover {
text-decoration:none;
color:#6CC7DC;
}

/* Structure */

#wrapper {
margin:0 auto;
width:1100px;
background:;
font-size:1.20em;

}
#header {
height:530px;
background:url(http://fc05.deviantart.net/fs71/f/2011/317/a/6/tutke_by_gashu_monsata-d4g4e5q.gif) no-repeat;
margin-left:160px;
}
#menu {
float:left;
width:175px;
height:350px;
background:url(http://fc07.deviantart.net/fs70/f/2011/317/2/2/textback_by_gashu_monsata-d4g4kz1.png) repeat-x;
padding:0 0px;
margin-left:-30px;
margin-top:-400px;
border-style:solid;
border-width:2px;
border-color:#5f9831;
}
#sidebar {
float:right;
width:180px;
height:350px;
background:url(http://fc07.deviantart.net/fs70/f/2011/317/2/2/textback_by_gashu_monsata-d4g4kz1.png);
margin-right:-50px;
margin-top:-400px;
border-style:solid;
border-width:2px;
border-color:#5f9831;
}
#content {
float:center;
margin-left:150px;
background:#bedde3;
border-style:solid;
border-width:2px;
border-color:#5f9831;

width:800px;
min-height:400px;
}
#footer {
clear:both;
height:100px;
background:url() no-repeat ;
}

/* Entries */

.entry {

font-size:1.4em;
color:#589ac2;
padding:5px 10px;
text-align:center;
line-height:1.75em;
}
.entry-title {

font-size:3em;
color:#36494d;
font-weight:bold;
letter-spacing:-1px;
style:Trebuchet MS;

}
.date {

font-size:0.9em;
color:#bedde3;
cursor:default;
letter-spacing:1px;
}
.comments {
margin-top:-1em;
}
.comments a {
color:#6CC7DC;
background:url(images/icon-comment.png) no-repeat 0px 2px;
padding-left:20px;
padding-right:2px;
}
.comments a:hover {
color:#B4C835;
}


/* Menu */

#menu ul {

list-style-type:none;
margin-top:10px;
}
#menu li {

}
#menu li a {
text-align:center;
display:block;
color:#ffffff;
margin-right:2px;
padding-left:5px;
font-size: 20px;
font-family:"Impact", Times, serif;
}
#menu li a:hover {
color:#2a5f5f;

}

/* Sidebar */

#sidebar ul {
list-style-type:none;
margin-top:10px;
}
#sidebar li {

}
#sidebar li a {
display:block;
height:20px;
line-height:20px;
color:#222222;
padding-left:5px;
border-bottom:1px solid #dddddd;
}
#sidebar li a:hover {
background:#edebed;
color:#6CC4D8;
}
#sidebar-bottom {

}

/* Footer */

#footer-valid {
float:center;
padding-top:55px;
padding-left:20px;
cursor:default;
color:#ffffff;
}
#footer-valid a {
color:#ffffff;
text-decoration:none;
}
#footer-valid a:hover {
color:#ffffff;
text-decoration:underline;
}

/* Heading's */

h1 {
opacity:0;
font-size:2.5em;
font-weight:normal;
cursor:default;
position:relative; top:50px; left:30px;
letter-spacing:1px;
color:#aaaaaa;
font-style:italic;
}

/* Feed */

#feed {
height:25px;
width:126px;
background:url(images/bg-feed.gif) no-repeat;
margin:0 auto;
padding-left:26px;
}
a.feed-button {
display:block;
width:100px;
height:25px;
background:url("images/button-feed.png") 0 0 no-repeat;
text-decoration: none;
}
a:hover.feed-button {
background-position:0 -25px;
}

/* Extra's */

#ad-top {
width:480px;
height:72px;
background:url(images/bg-ad-top.png) no-repeat;
padding:5px;
}

Or this one (not sure which one you wanted :P):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>:BROWSERTITLE:</title>
<link rel="stylesheet" href="templates/default/style.css" type="text/css" media="screen" />
</head>

<body>

<div id="wrapper">

<div id="header">
<h1>:SITENAME:</h1>
</div>

<div id="menu">
<ul>
:LINKSBAR:
</ul>
</div>

<div id="sidebar">
<div id="feed">
<a class="feed-button" href="account.php">&nbsp;</a>
</div>
<ul>
:SIDEFEED:
</ul>
<div id="sidebar-bottom">
&nbsp;
</div>
</div>

<div id="content">

<div class="entry">
<div class="entry-title"><br>:ARTICLETITLE:</div>
<div class="date">:ARTICLEDATE:</div>
<br><p>:ARTICLECONTENT:</p>
:ADS:


</div>

</div>

<div id="footer">
<div id="footer-valid">
<a href="http://www.rusnakweb.com/adoptables.php" target="_blank">Powered by Rusnak PHP Adoptables</a> | Theme by ginger ninja
</div>
</div>

</div>

</body>
</html>

SilverDragonTears
11-14-2011, 01:38 PM
Where do you edit the text for the home page?

Gashu
11-14-2011, 01:41 PM
The text? That's in the "Change Content" bit, not in the code. Unless you're on about editing the fonts and such, then that's this bit here:

/* Entries */

.entry {

font-size:1.4em;
color:#589ac2;
padding:5px 10px;
text-align:center;
line-height:1.75em;
}
.entry-title {

font-size:3em;
color:#36494d;
font-weight:bold;
letter-spacing:-1px;
style:Trebuchet MS;

}
.date {

font-size:0.9em;
color:#bedde3;
cursor:default;
letter-spacing:1px;
}
.comments {
margin-top:-1em;
}
.comments a {
color:#6CC7DC;
background:url(images/icon-comment.png) no-repeat 0px 2px;
padding-left:20px;
padding-right:2px;
}
.comments a:hover {
color:#B4C835;
}

SilverDragonTears
11-14-2011, 01:42 PM
btw. when I registered I saw this error at the top of register.php
Deprecated: Function eregi() is deprecated in /home/gashu/public_html/register.php on line 78

SilverDragonTears
11-14-2011, 01:44 PM
See, I'm not sure where you'd put it, because my site is different than the average MYS site :/

Gashu
11-14-2011, 01:47 PM
I just registered a tester account to check it out, that's weird? I have no idea what that is haha xD Well, it still seems to register fine so I hope it's nothing bad. I don't want to start fiddling with it because I'll screw it up :ohnoes:

SilverDragonTears
11-14-2011, 01:49 PM
LoL, I'm not quite sure either. I'm sure someone can tell you where to put it. Sorry I couldn't help you =( I don't use that to edit my pages.

Gashu
11-14-2011, 01:56 PM
It's okay, thanks for trying anyways :D What do you use for yours?

SilverDragonTears
11-14-2011, 02:02 PM
I just edit my index.php page

Gashu
11-14-2011, 02:37 PM
Ooooh! Index.php? This right? Maybe I could put it there? :P
<?php

include("inc/functions.php");
include("inc/bbcode.php");

//***************//
// START SCRIPT //
//***************//

getpage('index');

// Convert the BBCODE to HTML
$article_content = bbconvert($article_content);

// Convert line breaks to <br>
$article_content = nl2br($article_content);


//***************//
// OUTPUT PAGE //
//***************//

echo showpage($article_title, $article_content, $date);
?>

SilverDragonTears
11-14-2011, 02:44 PM
yes but it may not be in the spot you want it to be without the other stuff there.

Gashu
11-14-2011, 02:49 PM
Ah okay, I'll leave it for now then, I don't want to mess what I have up already :P

mapleblade
11-15-2011, 06:50 AM
maybe you could try this:

<?php

include("inc/functions.php");
include("inc/bbcode.php");

//***************//
// START SCRIPT //
//***************//

getpage('index');

// Convert the BBCODE to HTML
$article_content = bbconvert($article_content);

// Convert line breaks to <br>
$article_content = nl2br($article_content);

$query = "SELECT * FROM ".$prefix."adoptables ORDER BY id DESC LIMIT 5";
$result = runquery($query);


while($row = mysql_fetch_array($result)){
$image = getcurrentimage($row['id']);
article_content .= '<img src="{$image}" /><br /><b>{$row['type']}</b>';
}
//***************//
// OUTPUT PAGE //
//***************//

echo showpage($article_title, $article_content, $date);
?>

Gashu
11-15-2011, 06:59 AM
Oops nope, it made my site disappear with the error:
Parse error: syntax error, unexpected T_CONCAT_EQUAL in /home/gashu/public_html/index.php on line 24

It is supposed to go in the index.php file right? :P (I got the site back, no worries there xD)

mapleblade
11-15-2011, 07:20 AM
oh oops sec..



<?php

include("inc/functions.php");
include("inc/bbcode.php");

//***************//
// START SCRIPT //
//***************//

getpage('index');

// Convert the BBCODE to HTML
$article_content = bbconvert($article_content);

// Convert line breaks to <br>
$article_content = nl2br($article_content);

$query = "SELECT * FROM {$prefix}adoptables ORDER BY id DESC LIMIT 5";
$result = runquery($query);

while($row = mysql_fetch_array($result)){

$image = getcurrentimage($row['id']);
article_content .= '<img src="{$image}" /><br /><b>{$row['type']}</b>';
}
//***************//
// OUTPUT PAGE //
//***************//

echo showpage($article_title, $article_content, $date);
?>

Gashu
11-15-2011, 02:27 PM
Naww, still no luck :( It's okay, I can do it manually if not. I want to see if my Uni does some coding classes because I'd really love to learn PHP and CSS properly :D