Jump to content
Sign in to follow this  
perfectchoice

Making Platform Pro Play Well With Custom Scripts

Recommended Posts

perfectchoice

My partner and I have a site, www.hiringalandscaper.com. Right now the custom template we added is not working properly. It throws the page way out of kilter. We are thinking a java script pop may help solve but Im not sure where to begin so that everything plays well together. You can see our current results with going to the "directory" tab and using 28704 or most other zips. Just looks funky. Im not opposed to hiring help on this either. Whatever makes the experience right for our users. Thanks. [email protected] www.perfectchociemakreting.com

Share this post


Link to post
Share on other sites
cmunns

what is the custom script ? and what is it for? You are probably just missing some markup that throws the validation off.

Share this post


Link to post
Share on other sites
perfectchoice

Its for the search results. I'd hate to post the code to the forum and chew space. Is that the best way to illustrate it? Simply copying and pasting it to the thread?

Share this post


Link to post
Share on other sites
timlinson

You can post it here and surround the code with backticks (`). If it's really, really long, you can paste it to something like http://www.pastie.org/ and post the link here

Share this post


Link to post
Share on other sites
timlinson

Repost the code with backticks (` usually left of the 1) surrounding it or else the markup mangles the post.

Share this post


Link to post
Share on other sites
perfectchoice

` <?php /* Template Name: Landscaper Search */ get_header(); $var = $_POST['searchstate']; $trimmed = trim($var); //trim whitespace from the stored variable $link = mysql_connect('localhost', 'charlie1_charlie', '}SN$q}9bO?bG'); if (!$link) { die('Could not connect: ' . mysql_error()); } $searching=$_POST['searching']; $find=$_POST['find']; $searchstate=$_POST['searchstate']; $findstate=$_POST['findstate']; mysql_select_db(charlie1_CustomSearch); $result = mysql_query("SELECT * FROM zip_code WHERE zip_code LIKE'%$find%'") or die(mysql_error()); // store the record of the "example" table into $row $row = mysql_fetch_array( $result ); $x=$row['lat']; $y=$row['lon']; //if(isset($_POST['submitted'])) { if(isset($_POST['searching'])) // if ($searching=="yes") { ?>

<? mysql_select_db(charlie1_CustomSearch); // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM users WHERE zip LIKE'%$find%' ORDER BY level DESC"); $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query

"; } ?>

<? echo"$anymatches"; ?> Local Results Found

<? //And we display the results while($result = mysql_fetch_array( $data )) { $company=$result['company']; if ($result['level']==1) { echo("gold_star.gif $company "); } else { echo ""; echo $result['company']; echo""; } echo "

"; echo $result['address']; echo $result['city']; echo ", "; echo $result['state']; echo " "; echo $result['zip']; echo "

"; echo "Phone: "; echo $result['phone']; echo "*"; echo "Fax:"; echo $result['fax']; echo "

Website: "; echo ""; echo $result['website']; echo ""; echo "

About Us: "; echo $result['description']; echo "

Services Offered: "; echo $result['services']; echo "


"; } ?>
<? get_footer(); ?>
<? } //} else { ?>

Hiringalandscaper.com allows visitors the ability to easily find landscaping and related services in their local communities.

There is no need to sign up to search our database, simply enter your zip code in the box below and you will see a list of landscaping service providers that service your area.

In addition to landscape design and services you will also find many other related service providers for commercial and residential searchers.

Related service providers include: tree pruning and spraying, snow removal, seasonal cleanup, irrigation stump removal and many other services. Feel free to enter your zip code now and find a service provider near you!

<? get_footer(); ?>
<? } ?> `

Share this post


Link to post
Share on other sites
catrina

To clarify: Is this all one template or two codes for two separate templates? Sorry, I see two footers and I'm not sure where the template would end if both of them belong to the same template.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
perfectchoice

That could be part of the problem. I'm not the code side of the business, so please forgive my ignorance. It should be one template though

Share this post


Link to post
Share on other sites
kastelic

Looks fine in firefox and chrome, are you still having the issue, and if so what exactly is off-kilter?

Share this post


Link to post
Share on other sites
perfectchoice

Looks to me like the footer is missing. Instead of just populating the body and pushing the footer down as needed, it seems like it removes the footer. Throws the twitter widget out of place as well.

Share this post


Link to post
Share on other sites
catrina

Hm, things are looking fine when I look on Firefox. The footer is still there. Which browser are you using?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
perfectchoice

Safari mostly. It looks kinda out of alignment to me and sometiems the twitter widget floats weird. Maybe im being overly picky lol

Share this post


Link to post
Share on other sites
charliesalestacticstodaycom

Hey everyone, I am the other half of the landscaper website. What we are going for with the template is when someone visits the search page without a zip code being input they get the else part of the template. This just displays the welcome message and the search box. If they input a zip code and hit submit it will display results. That's why I made the two sections of code. Even though I am the "coder" of the crew I am still learning a lot! The problem we have is the footer will not show up. The full footer should be the same as on our "tools" page http://www.hiringalandscaper.com/tools/ but for some reason it completely disappears. Thanks to all those helping with this issue!

Share this post


Link to post
Share on other sites
timlinson

I see the second template block uses `#footer1` and your dynamic css also has a couple rules for it, so I assume this was intentional and not a typo? Was this part of the attempt to show different content for different users?

Share this post


Link to post
Share on other sites
charliesalestacticstodaycom

First, sorry for the messy code. It's been a while since I've worked on this so I'm not exactly sure where I was going with the footer1 Tim. Tonight I decided to break it down to the actual problem, the footer not showing for our custom template. The only code I have in there now is the following ` <?php /* Template Name: Landscaper Search */ get_header(); get_footer(); ?> ` and the default 5 column footer won't show. This is the only real issue we are having I think. I thought to show the footer that was all we needed??? Thanks for the patience and help everyone.

Share this post


Link to post
Share on other sites
charliesalestacticstodaycom

LOL, I figured the footer issue out. I guess when I created the template and the page and assigned the page to the template I left the check box on the "hide footer sidebars". I'm a little embarrassed about this issue but glad it's solved. Thanks!

Share this post


Link to post
Share on other sites
timlinson

hah no problem, glad you got it worked out

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×