Jump to content

nerotic

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nerotic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. http://www.krianmusicgroup.com/Krian/ On the homepage the bug is that there should only be 4 posts but it repeats posts 1 and 2. I really have no idea where to deal with this, or probably even how. Here is the source for the homepage: http://pastie.org/private/bfn8sekydisn564pezylq If anyone can offer me some insight I'd be most grateful.
  2. Long story short, I'm using a buggy WordPress template and we're too far into development to change. Good news is that we only have one item left to deal with and the rest I've been able to hack away at with my beginner PHP skills and a little help from a friend. The homepage of the template grabs all posts and creates a thumbnail. What I want to do is have those links go to the corresponding page. I just need to add some code any posts page that change the URL after WP's output <li><a href='localhost/brian/vhs_or_beta' title='VHS or Beta'>VHS or Beta</a></li> <li><a href='localhost/brian/the_ettes' title='The Ettes'>The Ettes</a></li> becomes <li><a href='localhost/brian/vhs-or-beta' title='VHS or Beta'>VHS or Beta</a></li> <li><a href='localhost/brian/the-ettes' title='The Ettes'>The Ettes</a></li> by changing "_" to "-" Just to be clear, I still want the page to draw using the latest posts but I want them to link to their corresponding page. I know it's repetitive but for the sake of clarity I've used the same names but I've used "_" to indicate post, and "-" to indicate page. I figured today would also be a good day to learn PHP regex but there are only 4 links and it's not changing any time soon. My question is whether it's a better idea to do this with a separate PHP script rather than try to hack WP....either way I'm out of my depth but I at least want to start trying in the right place. I'm thinking that the easiest way would be a small PHP script that would simple search 4 explicit URLs appearing in <a href> and changing them for 4 specific alteratives. Can anyone give me some guidance here? Thanks.
  3. Here's my $_SESSION start: <?php session_start(); $section = $_SESSION["nav"]; ?> My js: <script language="JavaScript" type="text/javascript"> $(document).ready(function() { $("div.tabs").tabs(".images > div", { // enable "cross-fading" effect effect: 'fade', fadeInSpeed: 600, fadeOutSpeed: 1000, // start from the beginning after the last tab rotate: false // use the slideshow plugin. It accepts its own configuration }).slideshow({autoplay: false, interval:5000}); $("a.lnav").onclick(function() { // Get the ID of the link var src = $(this).attr("id"); alert(id); // Send Ajax request to backend.php, with src set as "id in the POST data $.post("/backend.php", {"id": src}); }); }); </script> Here's backend.php: <?php // do any authentication first, then add POST variable to session $_SESSION['nav'] = $_POST['id']; ?> Why can't I get the alert(src) to work?
  4. Hey Catfish, Thanks for replying. I should have marked this forum solved but until now I hadn't seen the green button...too obvious I suppose I've actually moved onto bigger and better problems: http://www.phpfreaks.com/forums/index.php/topic,303153.0.html If you have any insight there I'd be grateful from what i remember of your page, "classic" is the first value (X) and "content=who" is the second value (Y) isn't it? the value of content will be passed around in $_GET (as long as each link the user clicks has a ?content=value part) and the other value is always defined by the page name.
  5. Extra comma in the css before the {} Will do it every time.
  6. Hi folks, On: http://nerotic.net/aux/ I'm using CSS to turn navigation red to indicate location and it's always worked in the past...but now it's not and I have no idea why. Here's the code I'm using (no comments about the <br />, that's going to be changed later on) <table width="185"> <tr> <td width="40" height="510"></td> <td width="105" height="510"align="center" valign="middle"> <a href="index.php?page=soundwhy" class="lnav" id="soundwhynav">why<a/><br /><br /><br /> <a href="index.php?page=soundhow" id="soundhownav" class="lnav">how<a/><br /><br /><br /> <a href="index.php?page=soundwhat" id="soundwhatnav" class="lnav">what<a/><br /><br /><br /> <a href="index.php?page=soundwhere" id="soundwherenav" class="lnav">where <a/><br /><br /> <br /> <a href="index.php?page=soundwho" id="soundwhonav" class="lnav">who<a/> </td> <td width="40" height="510" style="border-right: solid gray 0px;"></td> </tr> </table> and this is my CSS: body#soundwhy a#soundwhynav, body#soundhow a#soundhownav, body#soundwhat a#soundwhatnav, body#soundwhere a#soundwherenav, body#soundwho a.lnav#soundwhynav, { color:#E3170D; } As you can see I've tried reordering the elements (as silly as it might seem but nada. I also can't style the links by placing the class="lnav" in the <table> or <td> tag and have no idea why that doesn't want to take now.
  7. There's one more issue here... Technically everything is working just fine in terms of passing the variable. One unforeseen issue that has come up is since the $_SESSION "nav" is being set in an included document that's streamed into an overarching template the variable doesn't update in the template until the page is reloaded which means that the navigation is always one step behind what the user actually just clicked on. How can update the session variable w/o refreshing the page?
  8. In the end it was simple enough: Muffins dropped this little nugget on me: you need to set $_SESSION["nav"] somewhere so this: <?php $nav = "who"; echo $nav; ?> became this: <?php $_SESSION["nav"] = "who"; ?>
  9. I've changed the code to this in the index.php: <? session_start(); $section = $_SESSION["nav"]; echo $section; ?> and this in the file that's being included: <?php $nav = "who"; echo $nav; ?> In the included file the echo is working just fine, it's just not making it back to the index.html
  10. I don't understand the question. What element is missing? I've shown all the code that I'm using. And another question I have, do I need to open php sessions on all pages on the site in the event that people enter via a deep link?
  11. Ok..I've taken a new tack, using what I understand. In the include files I've added the following. In sound-where.php (which is being included by index.php) I have this line of code: <?php $nav = "where"; ?> Then in index.php I have the following at the top of the document: <? session_start(); $_SESSION["section"] = $_POST["nav"]; echo $_SESSION["section"]; ?> And then later I'm constructing my links as such: <a href="level.php?page=level<?php echo $section;?>" class="tnav"> <a href="box.php?page=box<?php echo $section;?>" class="tnav"> <a href="classic.php?page=box<?php echo $section;?>" class="tnav"> I'm not getting anything back from $nav though...blank. Can anyone tell me what I'm doing wrong? Thanks.
  12. so in order to pass this how would I have to construct a link...would it look something like this? <a href="classic.php?content=who">who</a>
  13. Think of it as a 5x5 matrix: x x x x x y y y y y The nav never changes and it's going to give us a much clearer way for users to compare data on the products. In any event, I could technically do it the way you described by concatenating two variable to form a page name...and in the end this is what it's actually going to do, just that the 1st part will be hardcoded (i.e. won't use a variable). I understand that I need to use a session varaible, what I don't know how to do is create and have the page store that variable. That's actually what I was asking
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.