View Full Version : Need help with php in layout cms.
jeremy860
April 5th, 2007, 06:04 PM
Ok, heres the deal, my domain.com/myspacelayouts is in the supplemental results in google because when you browse my layout categories, the title stays the same.
I was wondering if anybody here was familiar with the layout cms code and would know how to make it so my title would be like the following.
Myspace Layouts | Category Name | Page 1 and so on.....
minnseoelite
April 5th, 2007, 06:05 PM
Sorry man I have used that script and was wondering the same thing myself
jeremy860
April 5th, 2007, 06:17 PM
haha , I wish I had the time to learn php full course.
omen
April 5th, 2007, 06:25 PM
Well in your <title> </title> tags you'll want something like
<?php echo $title; ?>
Now you need to go in the code for index.php of the layout script, and add some code to set $title to a variable.
The variable you want is the layout title. so you need to use some MySQL Queries, and pull some info from the database to set the approriate URL.
You could then htaccess mod_rewrite the URL's so they're more SEO friendly.
Instead of index.php?asdasd?asdasds? oasasoda etc etc
you could have something like
myspacelayouts/download/12312/1123123.html
jeremy860
April 5th, 2007, 06:33 PM
yea I already have SEO urls, but since I dont know anything about PHP, I dont know how to pull the category name from the database.
Well in your <title> </title> tags you'll want something like
<?php echo $title; ?>
Now you need to go in the code for index.php of the layout script, and add some code to set $title to a variable.
The variable you want is the layout title. so you need to use some MySQL Queries, and pull some info from the database to set the approriate URL.
You could then htaccess mod_rewrite the URL's so they're more SEO friendly.
Instead of index.php?asdasd?asdasds? oasasoda etc etc
you could have something like
myspacelayouts/download/12312/1123123.html
deep
April 5th, 2007, 07:29 PM
yea I already have SEO urls, but since I dont know anything about PHP, I dont know how to pull the category name from the database.
ooohh that sucks, with php anything is possible LOVE IT :)
jeremy860
April 5th, 2007, 07:35 PM
with php anything is possible LOVE IT :)
yea I know, thats why back in 2002 when I was still using CGI and then I discovered PHP and have not looked back since. :)
Selena
April 5th, 2007, 07:38 PM
I got the guy to make a mod for me to pull the category name from the database...let me look at my code really quick.
Selena
April 5th, 2007, 07:43 PM
I'm not too familiar with mysql but i see this in my code somewhere:
$category_name = "";
if ($category !="" && $category != "all") {
$query = mysql_query("SELECT name FROM categories WHERE id = $category");
$result = mysql_fetch_assoc($query);
$category_name = $result['name'];
}
and then i know that whenever i want to display the category name i use the variable $category_name
jeremy860
April 5th, 2007, 07:45 PM
hmm I'll mess with it and see where it takes me.
jeremy860
April 5th, 2007, 07:51 PM
selena was there any other code before it like an If statement or anything? because all I get is a parse error.
Selena
April 5th, 2007, 07:51 PM
I would think that if you are using it to define the $title variable, then you'd do something like
$title = 'Myspace Layouts | '.$category_name.' | '.$page.' | '
or something along those lines :D
Selena
April 5th, 2007, 07:52 PM
it needs a closing bracket }
oh and this was before it :
if (!isset($page)) { $page = 1; }
$imageperpage = 10;
jeremy860
April 5th, 2007, 08:04 PM
hmm its not even parsing the code now, when I view my page and look up in the title, all I see is "Myspace Layouts $category_name"
jeremy860
April 5th, 2007, 08:50 PM
ok I'm not getting this so which php programmer wants to earn a quick $20? PM me if interested and I'll send you my index.php file and whatever else you need.
Selena
April 5th, 2007, 08:52 PM
you can get the maker of the script to do a mod for it probably for just $10.
Just IM him on aim. He's usually very helpful about mods.
jeremy860
April 5th, 2007, 09:09 PM
you can get the maker of the script to do a mod for it probably for just $10.
Just IM him on aim. He's usually very helpful about mods.
i'll give that a go, if I can ever catch him online :)
mawt
April 5th, 2007, 09:37 PM
^^^ I've tried so many times to contact him, and sent him many emails for weeks....
jeremy860
April 5th, 2007, 09:43 PM
yea I know, its a headache to get ahold of him.
this is pretty much the only remaining problem I have with the cms then otherwise I have pretty much got it how I want it.
Kasami2k4
April 5th, 2007, 10:03 PM
Haha jeremy, easy solution for that. Hover your arrow oer a layout and look at the status bar at the bottom. thats how I figured out how. Way easier than selenas version
jeremy860
April 5th, 2007, 10:05 PM
Haha jeremy, easy solution for that. Hover your arrow oer a layout and look at the status bar at the bottom. thats how I figured out how. Way easier than selenas version
huh? hows that going to code php into my title tags?
Kasami2k4
April 5th, 2007, 10:31 PM
http://www.webmaster-talk.com/php-forum/13299-php-dynamic-page-title-and-heading.html
jeremy860
April 5th, 2007, 10:36 PM
http://www.webmaster-talk.com/php-forum/13299-php-dynamic-page-title-and-heading.html
that makes my head want to explode. have you actually did this with layout cms? mind posting your code?
deep
April 5th, 2007, 11:03 PM
that makes my head want to explode. have you actually did this with layout cms? mind posting your code?
im not exactly sure what you want to do but from your concerns it looks easy so feel free to hit me up on aim/yim and i can do it! :)
jeremy860
April 5th, 2007, 11:12 PM
im not exactly sure what you want to do but from your concerns it looks easy so feel free to hit me up on aim/yim and i can do it! :)
awesome! I am on AIM whenever your ready.
jeremy860
April 6th, 2007, 12:12 AM
thank you so much deep for your help. my problem has been solved :)
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.