Jump to content

madsrh

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by madsrh

  1. Why depend on wordpress? why not dyi?
    It might seem like an odd choice at first. I believe that the friendly UI, extensive documentation and huge availability of widgets is just a few of the many positives. I've just created a basic theme that is easily installed. Afterwards you have all the widgets (about 3.400) for Wordpress available to you and of course you can code your own with a bit of PHP.
  2. That Javascript code doesn't set IDs on divs, it is supposed to be passing IDs of existing elements to put the RSS content into. That loop will keep incrementing i and pass each ID to the constructor, starting at 0 (rss0, rss1, rss2, etc). You need to have those elements already on the page, or add code to the loop to create and append the elements before trying to load RSS content into them.
    Sorry, I see that now. But when I set the DIV with ID="rss1" the content doesn't show up :boredom:Does the ID only work inside the JS scope? I really don't understand why it doesn't show up inside the DIV in my PHP function.
  3. It's a Google API. I disapprove of the programming style, but it looks like OP is doing it right. I think. Anyway, I think the question gets answered like this:
    var feedArray = [   "http://www.dr.dk/nyheder/service/feeds/allenyheder",   "http://feeds.feedburner.com/d0od?format=xml",   "http://www.engadget.com/rss.xml",   "http://feeds.newzmedia.dk/c/32893/f/582669/index.rss"];for (var i = 0, len = feedArray.length; i < len; i++) {   new GFdynamicFeedControl(feedArray[i], "rss" + i);}

    Now you can add an arbitrary number of addresses to the array without changing the rest of the code.

    Thanks for the reply. I don't know why, but this didn't work. I looks like all the DIVs have the ID rss1. I'm trying to add a Wordpress RSS widget (http://stackoverflow.com/questions/15560865/output-url-to-wordpress-widget). So the URLs should be PHP variables from $lineOne.
  4. Hi Can someone tell me how to do a foreach and increase the "rss1" number inside this javascript?

     <script type="text/javascript">	function load() {	   var feed ="http://www.dr.dk/nyheder/service/feeds/allenyheder";	  new GFdynamicFeedControl(feed, "rss1");  var feedtwo ="http://feeds.feedburner.com/d0od?format=xml";	  new GFdynamicFeedControl(feedtwo, "rss2");	   var feedtwo ="http://www.engadget.com/rss.xml";	  new GFdynamicFeedControl(feedtwo, "rss3");  var feedtwo ="http://feeds.newzmedia.dk/c/32893/f/582669/index.rss";	  new GFdynamicFeedControl(feedtwo, "rss4");	}	google.load("feeds", "1");	google.setOnLoadCallback(load);  </script>

    I also need the var feed which is the RSS url set in this widget http://pastie.org/7088004 Any help is appreciated :fool:

  5. Thanks for all the feedback!!! :Pleased:

    I think, first of all, that you should be initializing the variable as an array:$CustomMenuLinks = array();
    I'm a newbie with PHP, so I'm just trying to understand how this works. Would an array look like this:
    $CustomMenuLinks = array(	  "YouTube" => "www.youtube.com",	  "Gmail" => "www.gmail.com",);

    You have return statement inside your foreach loop which is causing to break the loop and exiting from the function on first iteration even if there is more element on the array.
    But I can't do it without the Return command. I've tried echo, but it doesn't help me.
  6. Hi. Can anyone tell me why this code only adds one menu item to my wordpress nav? I'm sure this could be done with an array, but I couldn't figure out how.

    add_filter( 'wp_list_pages', 'my_menu_link' );add_filter( 'wp_nav_menu_items', 'my_menu_link' ); function my_menu_link($items) {	global $wp_query; $CustomMenuLinks;$CustomMenuLinks["Gmail"] = "www.gmail.com";$CustomMenuLinks["YouTube"] = "www.youtube.com";$CustomMenuLinks["aaaaaaaa"] = "www.sdsaaaaaaaaa.com";$class ='menu-item'; foreach( $CustomMenuLinks as $title=> $url){	$menu_link = '<li class="'.$class.'"><a href="'.$url.'">'.$title.'</a></li>';			$items = $items . $menu_link;return $items;	}}

    //MadsRH

  7. HiI'm trying to add an option page with a colorpick to my wordpress site, but I can't make the INPUT background update when a color is selected. I added a STYLE but this will only update the background color when I save the changes. I'm pretty sure that it's in the code below or in the javascript file the error is:

    <input type="text" name="my-theme-options[color]" value="<?php echo esc_attr( $options['color'] ); ?>" style="background-color: <?php echo esc_attr( $options['color'] ); ?>" id="color" />

    Here's my code: http://pastebin.com/YHUR6HMk Based on this tutorial: http://theme.fm/2011/08/using-the-color-picker-in-your-wordpress-theme-options-2152/ Can someone please help?//MadsRH

  8. HiI'm trying to set up “sign-in with Google” feature (https://developers.g...ocs/OAuth2Login) for my website, so I can access my private Google calendars on the site. This is way to advanced for me, but fortunately there's a sample snipet I can use. My problem is that it says:

    [color=#ff0000]// Set your cached access token. Remember to replace $_SESSION with a[/color][color=#ff0000]// real database or memcached.[/color]session_start();

    and then later:

    [color=#ff0000] Remember to update the cached access token.[/color]  // Remember to replace $_SESSION with a real database or memcached.  $_SESSION['token'] = $client->getAccessToken();} else {  $authUrl = $client->createAuthUrl();  print "<a href='$authUrl'>Connect Me!</a>";}

    But where should I write this and is it just the name? Thanks for reading this far :Pleased:MadsRH

×
×
  • Create New...