Jump to content

DSchragg

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DSchragg's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This worked perfectly.... Thanks so much QuickOldCar.....I really need to learn more PHP. So much less code too......thanks again!
  2. Could someone tell me how to make this work as one statement? Right now it's returning results for every if statement.... <!--About--> <?php if (is_page(26) || $post->post_parent=="26") { ?> <p><?php randomtext('about'); ?></p> <?php } else { ?> <p><?php randomtext('default'); ?></p> <?php } ?> <!--Get Involved--> <?php if (is_page(17) || $post->post_parent=="17") { ?> <p><?php randomtext('get-involved'); ?></p> <?php } else { ?> <p><?php randomtext('default'); ?></p> <?php } ?> <!--Resources--> <?php if (is_page(51) || $post->post_parent=="51") { ?> <p><?php randomtext('resources'); ?></p> <?php } else { ?> <p><?php randomtext('default'); ?></p> <?php } ?> <!--Gallery--> <?php if (is_page(55) || $post->post_parent=="55") { ?> <p><?php randomtext('gallery'); ?></p> <?php } else { ?> <p><?php randomtext('default'); ?></p> <?php } ?> <!--Whats New--> <?php if (is_page(69) || $post->post_parent=="69") { ?> <p><?php randomtext('whats-new'); ?></p> <?php } else { ?> <p><?php randomtext('default'); ?></p> <?php } ?> <!--Testimonials--> <?php if (is_page(71) || $post->post_parent=="71") { ?> <p><?php randomtext('testimonials'); ?></p> <?php } else { ?> <p><?php randomtext('default'); ?></p> <?php } ?> Thanks in advance for any help.....
  3. Can someone tell me what's wrong with this? I'm trying to remove any folders listed in the url but maintaining the rest of the structure.... Example: http://example.com/test/test.php changes to http://example.com/test.php My current config is removing the folder but leaving a double slash - i.e. http://example.com//test.php Any help is greatly appreciated! <?php function modify_url($mod) { $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $query = explode("/", $_SERVER['QUERY_STRING']); // modify/delete data foreach($query as $q) { list($key, $value) = explode("/", $q); if(array_key_exists($key, $mod)) { if($mod[$key]) { } else { $url = preg_replace('/&?'.$key.'wp'.$value.'/', '', $url); } } } // add new data return $url; } $url = modify_url(array('' => '')); ?> <?php echo $url ?>
  4. I'm wondering how I can use the following code to capture the current url...... <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?> <?php echo curPageURL(); ?> and then have the output modified to change the domain name and create a link. Example: before - http://website1.com/page after - http://website2.com/page I think this would be done using function modify_url, but I'm not sure how to do it, any help would be greatly appreciated. Thanks
  5. I currently have Wordpress 3.1 running in network mode so that I could have 1 site but in 2 languages. the url's are as follows: http://mysite.com/ - English http://mysite.com/fr - French I want to have a link embedded in the template that will say either French or English and when clicked take the user to the same page they are viewing but in the other language. All my pages and articles on both sites will have the same permalinks, so what I want to have is a link that will grab the current url or page being viewed and add the fr into the link automatically, so that I never have to manually update these links. Example: When viewing Page 1 English, the href would automatically provide a link to Page 1 in French, and update itself dynamically as you viewed different pages.. mysite.com/page1 turns into mysite.com/fr/page1 Is this possible? Thanks for everyones help.
  6. Ok so I edited my .htaccess file, and this did not work...maybe host? This did work however: if($_SERVER['SERVER_NAME'] == 'french.mysite.com'){ header('Location: http://french.mysite.com/index_french.html'); } Thanks for your help!
  7. Wow, that was quick, thanks for your help. I'm going to try this now and report back......
  8. Hello Everyone, this is my first post on this great and very useful site. I'm hoping someone can give me a quick and simple answer for this one..... Here's my scenario: I have 2 domain names that point to one website. One domain is english the other french. I want an index.php file to handle what index file is loaded. If the user types in french.com I want it to load the index_french.html file, if the user types english.com I want the site to load index.html Sounds simple enough, but I may be wrong? Thanks in advance for your help.
×
×
  • 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.