Advertisement
Guest User

Kevin Banet

a guest
Apr 20th, 2010
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 31.86 KB | None | 0 0
  1. <?php
  2. $themename = "WPSN";
  3. $shortname = "stylewp";
  4.  
  5. $stylewp_categories_obj = get_categories('hide_empty=0');
  6. $stylewp_categories = array();
  7.  
  8. $sidebarlatest = array("Select a Number:","1","3","4","5","6","7","2","8","9","10","11","13","14","15","16","17","12","18","19","30","31","33","34","35","36","37","32","38","39","40","41","43","44","45","46","47","42","48","49","50","51","53","54","55","56","57","52","58","59","60");
  9.  
  10. foreach ($stylewp_categories_obj as $stylewp_cat) {
  11. $stylewp_categories[$stylewp_cat->cat_ID] = $stylewp_cat->cat_name;
  12. }
  13.  
  14. $categories_tmp = array_unshift($stylewp_categories, "Select a category:");
  15.  
  16. $options = array (
  17.  
  18.  
  19.  
  20.  
  21.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">General Settings</h4></div>",
  22.                         "type" => "heading"),
  23.  
  24.  
  25.                 array(  "name" => "Activate News Ticker?",
  26.                         "desc" => "Check to activate the RSS news ticker on your frontpage<br />(See users guide for setup instructions)<br /><br />",
  27.                         "id" => $shortname."_showticker",
  28.                         "std" => "true",
  29.                         "type" => "checkbox"),
  30.  
  31.                 array(  "name" => "Activate Pages Menu?",
  32.                         "desc" => "Check to activate your 'Pages' menu<br /><br />",
  33.                         "id" => $shortname."_showpagesmenu",
  34.                         "std" => "true",
  35.                         "type" => "checkbox"),
  36.  
  37.                 array(  "name" => "Activate Categories Menu?",
  38.                         "desc" => "Check to activate your 'Categories' menu<br /><br />",
  39.                         "id" => $shortname."_showcatsmenu",
  40.                         "std" => "true",
  41.                         "type" => "checkbox"),
  42.  
  43.                 array(  "name" => "Activate Todays Date?",
  44.                         "desc" => "Check to activate the date and time in your header<br /><br />",
  45.                         "id" => $shortname."_showdate",
  46.                         "std" => "true",
  47.                         "type" => "checkbox"),
  48.  
  49.  
  50.                 array(  "name" => "More News Title",
  51.                     "desc" => "Edit the more news block.<br /><br />",
  52.                         "id" => $shortname."_haveyouread",
  53.                         "std" => "Have you read?",
  54.                         "type" => "text"),
  55.  
  56.                 array(  "name" => "Show 'Top' link?",
  57.                         "desc" => "Check to activate the 'top' link in your footer<br /><br />",
  58.                         "id" => $shortname."_showtop",
  59.                         "std" => "true",
  60.                         "type" => "checkbox"),
  61.  
  62.                 array(  "name" => "Edit 'Top' text",
  63.                     "desc" => "Edit the 'top' link text.<br /><br /><br />",
  64.                         "id" => $shortname."_toplink",
  65.                         "std" => "Back to the Top",
  66.                         "type" => "text"),
  67.  
  68.  
  69.  
  70.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Google Analytics</h4></div>",
  71.  
  72.                         "type" => "heading"),
  73.  
  74.  
  75.  
  76.                 array(  "name" => "Analytics Code",
  77.                         "desc" => "Paste your Google analytics code here or<br />leave blank to deactivate this setting.<br /><br />",
  78.                         "id" => $shortname."_analytics",
  79.                         "std" => "",
  80.                         "type" => "textarea"),
  81.  
  82.  
  83.  
  84.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">META Settings</h4></div>",
  85.  
  86.                         "type" => "heading"),
  87.  
  88.  
  89.                 array(  "name" => "Keywords",
  90.                         "desc" => "Give your site some META keywords<br /><br />",
  91.                         "id" => $shortname."_keywords",
  92.                         "std" => "Enter keywords seperated with a comma",
  93.                         "type" => "textarea"),
  94.  
  95.  
  96.  
  97.                 array(  "name" => "Description",
  98.                         "desc" => "Give your site a META description<br /><br /><br />",
  99.                         "id" => $shortname."_description",
  100.                         "std" => "Enter a description for the search engines",
  101.                         "type" => "textarea"),
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Members Menu</h4></div>",
  113.                         "type" => "heading"),
  114.  
  115.  
  116.  
  117.                 array(  "name" => "Home Link",
  118.                     "desc" => "Give this link a suitable title.<br /><br />",
  119.                         "id" => $shortname."_toplinks1",
  120.                         "std" => "WPSN.com",
  121.                         "type" => "text"),
  122.  
  123.                 array(  "name" => "Admin Link",
  124.                     "desc" => "Give this link a suitable title.<br /><br />",
  125.                         "id" => $shortname."_toplinks3",
  126.                         "std" => "MyWPSN",
  127.                         "type" => "text"),
  128.  
  129.  
  130.                 array(  "name" => "Profile Link",
  131.                     "desc" => "Give this link a suitable title.<br /><br />",
  132.                         "id" => $shortname."_toplinks4",
  133.                         "std" => "Profile",
  134.                         "type" => "text"),
  135.  
  136.                 array(  "name" => "Register Link",
  137.                     "desc" => "Give this link a suitable title.<br /><br />",
  138.                         "id" => $shortname."_toplinks5",
  139.                         "std" => "Register",
  140.  
  141.  
  142.  
  143.  
  144.  
  145.                         "type" => "text"),
  146.  
  147.                 array(  "name" => "Password Link",
  148.                     "desc" => "Give this link a suitable title.<br /><br /><br />",
  149.                         "id" => $shortname."_toplinks6",
  150.                         "std" => "Forgot Password?",
  151.                         "type" => "text"),
  152.  
  153.  
  154.  
  155.  
  156.  
  157.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Search Settings</h4></div>",
  158.                         "type" => "heading"),
  159.  
  160.  
  161.  
  162.                 array(  "name" => "Search Tagline",
  163.                     "desc" => "Add a suitable tagline above your frontpage search field.<br /><br />",
  164.                         "id" => $shortname."_searchtagline",
  165.                         "std" => "Try the powerful WPSN search:",
  166.                         "type" => "text"),
  167.  
  168.                 array(  "name" => "Search field text",
  169.                     "desc" => "Add some text to your search field.<br /><br />",
  170.                         "id" => $shortname."_searchline",
  171.                         "std" => "Search our site . . .",
  172.                         "type" => "text"),
  173.  
  174.  
  175.                 array(  "name" => "Selected Search Text",
  176.                     "desc" => "Add some text above your selected search area.<br /><br />",
  177.                         "id" => $shortname."_searchestagline",
  178.                         "std" => "Selected WPSN searches:",
  179.                         "type" => "text"),
  180.  
  181.                 array(  "name" => "Search Term #1",
  182.                     "desc" => "Add a single-word search term here.<br /><br />",
  183.                         "id" => $shortname."_search1",
  184.                         "std" => "Rankings",
  185.                         "type" => "text"),
  186.  
  187.                 array(  "name" => "Search Term #3",
  188.                     "desc" => "Add a single-word search term here.<br /><br />",
  189.                         "id" => $shortname."_search3",
  190.                         "std" => "Fantasy",
  191.                         "type" => "text"),
  192.  
  193.                 array(  "name" => "Search Term #4",
  194.                     "desc" => "Add a single-word search term here.<br /><br />",
  195.                         "id" => $shortname."_search4",
  196.                         "std" => "Picks",
  197.                         "type" => "text"),
  198.  
  199.                 array(  "name" => "Search Term #5",
  200.                     "desc" => "Add a single-word search term here.<br /><br />",
  201.                         "id" => $shortname."_search5",
  202.                         "std" => "Injuries",
  203.                         "type" => "text"),
  204.  
  205.                 array(  "name" => "Search Term #6",
  206.                     "desc" => "Add a single-word search term here.<br /><br />",
  207.                         "id" => $shortname."_search6",
  208.                         "std" => "Projections",
  209.                         "type" => "text"),
  210.  
  211.                 array(  "name" => "Search Term #7",
  212.                     "desc" => "Add a single-word search term here.<br /><br />",
  213.                         "id" => $shortname."_search7",
  214.                         "std" => "Rookies",
  215.                         "type" => "text"),
  216.  
  217.                 array(  "name" => "Search Term #2",
  218.                     "desc" => "Add a single-word search term here.<br /><br />",
  219.                         "id" => $shortname."_search2",
  220.                         "std" => "Blogs",
  221.                         "type" => "text"),
  222.  
  223.                 array(  "name" => "Search Term #8",
  224.                     "desc" => "Add a single-word search term here.<br /><br /><br />",
  225.                         "id" => $shortname."_search8",
  226.                         "std" => "Superbowl",
  227.                         "type" => "text"),
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Frontpage Static Links</h4></div>",
  235.                         "type" => "heading"),
  236.  
  237.  
  238.  
  239.                 array(  "name" => "Sub-Link #1",
  240.                     "desc" => "Give this link a suitable title.<br /><br />",
  241.                         "id" => $shortname."_lbox1txt",
  242.                         "std" => "Watch: Implications",
  243.                         "type" => "text"),
  244.  
  245.                 array(  "name" => "Sub-Link URL #1",
  246.                     "desc" => "Enter the link destination.<br /><br />",
  247.                         "id" => $shortname."_lbox1url",
  248.                         "std" => "#",
  249.                         "type" => "text"),
  250.  
  251.  
  252.  
  253.  
  254.  
  255.                 array(  "name" => "Sub-Link #3",
  256.                     "desc" => "Give this link a suitable title.<br /><br />",
  257.                         "id" => $shortname."_lbox3txt",
  258.                         "std" => "Zoom Gallery",
  259.                         "type" => "text"),
  260.  
  261.                 array(  "name" => "Sub-Link URL #3",
  262.                     "desc" => "Enter the link destination.<br /><br />",
  263.                         "id" => $shortname."_lbox3url",
  264.                         "std" => "#",
  265.                         "type" => "text"),
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                 array(  "name" => "Sub-Link #4",
  272.                     "desc" => "Give this link a suitable title.<br /><br />",
  273.                         "id" => $shortname."_lbox4txt",
  274.                         "std" => "Giants 41 - 45 Redskins",
  275.                         "type" => "text"),
  276.  
  277.                 array(  "name" => "Sub-Link URL #4",
  278.                     "desc" => "Enter the link destination.<br /><br />",
  279.                         "id" => $shortname."_lbox4url",
  280.                         "std" => "#",
  281.                         "type" => "text"),
  282.  
  283.  
  284.  
  285.  
  286.  
  287.                 array(  "name" => "Sub-Link #5",
  288.                     "desc" => "Give this link a suitable title.<br /><br />",
  289.                         "id" => $shortname."_lbox5txt",
  290.                         "std" => "Leap of faith",
  291.                         "type" => "text"),
  292.  
  293.                 array(  "name" => "Sub-Link URL #5",
  294.                     "desc" => "Enter the link destination.<br /><br />",
  295.                         "id" => $shortname."_lbox5url",
  296.                         "std" => "#",
  297.                         "type" => "text"),
  298.  
  299.  
  300.  
  301.  
  302.  
  303.                 array(  "name" => "Sub-Link #6",
  304.                     "desc" => "Give this link a suitable title.<br /><br />",
  305.                         "id" => $shortname."_lbox6txt",
  306.                         "std" => "Bulls 99 - 103 Lakers",
  307.                         "type" => "text"),
  308.  
  309.                 array(  "name" => "Sub-Link URL #6",
  310.                     "desc" => "Enter the link destination.<br /><br />",
  311.                         "id" => $shortname."_lbox6url",
  312.                         "std" => "#",
  313.                         "type" => "text"),
  314.  
  315.  
  316.  
  317.  
  318.  
  319.                 array(  "name" => "Sub-Link #7",
  320.                     "desc" => "Give this link a suitable title.<br /><br />",
  321.                         "id" => $shortname."_lbox7txt",
  322.                         "std" => "NFL Europa LIVE!",
  323.                         "type" => "text"),
  324.  
  325.                 array(  "name" => "Sub-Link URL #7",
  326.                     "desc" => "Enter the link destination.<br /><br />",
  327.                         "id" => $shortname."_lbox7url",
  328.                         "std" => "#",
  329.                         "type" => "text"),
  330.  
  331.  
  332.  
  333.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Selectable News Block</h4></div>",
  334.                         "type" => "heading"),
  335.  
  336.  
  337.                 array(  "name" => "Item #1",
  338.                         "desc" => "Select the category this area will display news from.<br /><br />",
  339.                         "id" => $shortname."_fl1l",
  340.                         "std" => "Select a category:",
  341.                         "type" => "select",
  342.                         "options" => $stylewp_categories),
  343.  
  344.                 array(  "name" => "Item #3",
  345.                         "desc" => "Select the category this area will display news from.<br /><br />",
  346.                         "id" => $shortname."_fl3l",
  347.                         "std" => "Select a category:",
  348.                         "type" => "select",
  349.                         "options" => $stylewp_categories),
  350.  
  351.                 array(  "name" => "Item #4",
  352.                         "desc" => "Select the category this area will display news from.<br /><br />",
  353.                         "id" => $shortname."_fl4l",
  354.                         "std" => "Select a category:",
  355.                         "type" => "select",
  356.                         "options" => $stylewp_categories),
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Latest News Links</h4></div>",
  364.                         "type" => "heading"),
  365.  
  366.  
  367.  
  368.                 array(  "name" => "Link #1",
  369.                     "desc" => "Give this link a suitable title.<br /><br />",
  370.                         "id" => $shortname."_newslink1",
  371.                         "std" => "Latest News",
  372.                         "type" => "text"),
  373.  
  374.  
  375.  
  376.  
  377.  
  378.                 array(  "name" => "Link #3",
  379.                     "desc" => "Give this link a suitable title.<br /><br />",
  380.                         "id" => $shortname."_newslink3",
  381.                         "std" => "Rumor Central",
  382.                         "type" => "text"),
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.                 array(  "name" => "Link #3 Destination",
  391.                     "desc" => "Paste the destination URL for this link.<br /><br />",
  392.                         "id" => $shortname."_newslink3url",
  393.                         "std" => "#",
  394.                         "type" => "text"),
  395.  
  396.  
  397.  
  398.                 array(  "name" => "Link #4",
  399.                     "desc" => "Give this link a suitable title.<br /><br />",
  400.                         "id" => $shortname."_newslink4",
  401.                         "std" => "On WPSN TV",
  402.                         "type" => "text"),
  403.  
  404.  
  405.  
  406.                 array(  "name" => "Link #4 Destination",
  407.                     "desc" => "Paste the destination URL for this link.<br /><br />",
  408.                         "id" => $shortname."_newslink4url",
  409.                         "std" => "#",
  410.                         "type" => "text"),
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Promotional Settings</h4></div>",
  419.                         "type" => "heading"),
  420.  
  421.                 array(  "name" => "<h5 style=\"color:#cc0000;\">Block #1</h5></div>",
  422.                         "type" => "heading"),
  423.  
  424.                 array(  "name" => "Block Title",
  425.                     "desc" => "Give this block a title.<br /><br /><br />",
  426.                         "id" => $shortname."_ptitle",
  427.                         "std" => "Featured Promotional Block",
  428.                         "type" => "text"),
  429.  
  430.  
  431.                 array(  "name" => "Left Title",
  432.                     "desc" => "Enter a header for this block.<br /><br />",
  433.                         "id" => $shortname."_p1h1",
  434.                         "std" => "This is a suitable title for this block",
  435.                         "type" => "text"),
  436.  
  437.                 array(  "name" => "Left Image",
  438.                     "desc" => "Enter the URL to your chosen image.<br /><br />",
  439.                         "id" => $shortname."_p1img",
  440.                         "std" => "http://stylewp.com/assets/author_1.jpg",
  441.                         "type" => "text"),
  442.  
  443.                 array(  "name" => "Left Contents",
  444.                     "desc" => "Enter some relevant text here.<br /><br />",
  445.                         "id" => $shortname."_p1txt",
  446.                         "std" => "This is some text to accompany the above image and is controlled using the built-in theme control panel.",
  447.                         "type" => "textarea"),
  448.  
  449.                 array(  "name" => "Left Destination",
  450.                     "desc" => "Enter the destination URL here.<br /><br /><br />",
  451.                         "id" => $shortname."_p1url",
  452.                         "std" => "#",
  453.                         "type" => "text"),
  454.  
  455.  
  456.  
  457.  
  458.                 array(  "name" => "Right Title",
  459.                     "desc" => "Enter a header for this block.<br /><br />",
  460.                         "id" => $shortname."_p3h1",
  461.                         "std" => "This is a suitable title for this block",
  462.                         "type" => "text"),
  463.  
  464.                 array(  "name" => "Right Image",
  465.                     "desc" => "Enter the URL to your chosen image.<br /><br />",
  466.                         "id" => $shortname."_p3img",
  467.                         "std" => "http://stylewp.com/assets/author_3.jpg",
  468.                         "type" => "text"),
  469.  
  470.                 array(  "name" => "Right Contents",
  471.                     "desc" => "Enter some relevant text here.<br /><br />",
  472.                         "id" => $shortname."_p3txt",
  473.                         "std" => "This is some text to accompany the above image and is controlled using the built-in theme control panel.",
  474.                         "type" => "textarea"),
  475.  
  476.                 array(  "name" => "Right Destination",
  477.                     "desc" => "Enter the destination URL here.<br /><br /><br />",
  478.                         "id" => $shortname."_p3url",
  479.                         "std" => "#",
  480.                         "type" => "text"),
  481.  
  482.  
  483.  
  484.  
  485.  
  486.                 array(  "name" => "<h5 style=\"color:#cc0000;\">Block #3</h5></div>",
  487.                         "type" => "heading"),
  488.  
  489.  
  490.  
  491.                 array(  "name" => "Block Title",
  492.                     "desc" => "Give this block a title.<br /><br /><br />",
  493.                         "id" => $shortname."_pbtitle",
  494.                         "std" => "Another Promotional Block",
  495.                         "type" => "text"),
  496.  
  497.  
  498.                 array(  "name" => "Destination",
  499.                     "desc" => "Enter the destination URL here.<br /><br />",
  500.                         "id" => $shortname."_pburl",
  501.                         "std" => "#",
  502.                         "type" => "text"),
  503.  
  504.  
  505.  
  506.                 array(  "name" => "Image",
  507.                     "desc" => "Enter your chosen image URL.<br /><br />",
  508.                         "id" => $shortname."_pbimg",
  509.                         "std" => "http://stylewp.com/assets/400_promo.jpg",
  510.                         "type" => "text"),
  511.  
  512.  
  513.  
  514.                 array(  "name" => "Alt Text",
  515.                     "desc" => "Enter some relevant text which is used as the image alt.<br /><br /><br />",
  516.                         "id" => $shortname."_pbalt",
  517.                         "std" => "This is a promotional block",
  518.                         "type" => "text"),
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Inner Pages Control</h4></div>",
  526.  
  527.                         "type" => "heading"),
  528.  
  529.                 array(  "name" => "Author Sub-Text",
  530.                     "desc" => "Edit the line of text underneath each authors name.<br /><br />",
  531.                         "id" => $shortname."_authorsub",
  532.                         "std" => "for WPSN.com",
  533.                         "type" => "text"),
  534.  
  535.                 array(  "name" => "Published",
  536.                     "desc" => "Edit the published date text.<br /><br />",
  537.                         "id" => $shortname."_publishedon",
  538.                         "std" => "Published:",
  539.                         "type" => "text"),
  540.  
  541.                 array(  "name" => "Show Tags?",
  542.                         "desc" => "Check to show tags under each news item<br /><br />",
  543.                         "id" => $shortname."_showtags",
  544.                         "std" => "true",
  545.                         "type" => "checkbox"),
  546.  
  547.                 array(  "name" => "Show Gravatars?",
  548.                         "desc" => "Check to activate <a href=\"http://gravatar.com\">Gravatar</a> support for your comments<br /><br />",
  549.                         "id" => $shortname."_showava",
  550.                         "std" => "true",
  551.                         "type" => "checkbox"),
  552.  
  553.                 array(  "name" => "Related Items",
  554.                     "desc" => "Edit the Related Items header text.<br /><br />",
  555.                         "id" => $shortname."_siderelated",
  556.                         "std" => "Related News Headlines",
  557.                         "type" => "text"),
  558.  
  559.                 array(  "name" => "Latest Items",
  560.                     "desc" => "Edit the Latest Items header text.<br /><br />",
  561.                         "id" => $shortname."_sidelatest",
  562.                         "std" => "WPSN Latest",
  563.                         "type" => "text"),
  564.  
  565.                 array(  "name" => "How Many Latest Items?",
  566.                         "desc" => "Select how many Latest Items to show in your sidebar.",
  567.                         "id" => $shortname."_sidebarlatest",
  568.                                 "std" => "Select a Number:",
  569.                                     "type" => "select",
  570.                             "options" => $sidebarlatest),
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Advertisement Settings</h4></div>",
  580.                         "type" => "heading"),
  581.  
  582.  
  583.  
  584.  
  585.  
  586.                 array(  "name" => "Spot #1",
  587.                     "desc" => "Paste your <b>238x90</b> ad code above.<br /><br />",
  588.                         "id" => $shortname."_banner1",
  589.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner1.gif\" /></a>",
  590.                         "type" => "textarea"), 
  591.  
  592.  
  593.  
  594.                 array(  "name" => "Spot #3",
  595.                     "desc" => "Paste your <b>447x380</b> ad code above.<br /><br />",
  596.                         "id" => $shortname."_banner3",
  597.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner3.gif\" border=\"0\" /></a>",
  598.                         "type" => "textarea"), 
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.                 array(  "name" => "Spot #4",
  606.                     "desc" => "Paste your <b>400x60</b> ad code above.<br /><br />",
  607.                         "id" => $shortname."_banner4",
  608.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner4.gif\" border=\"0\" /></a>",
  609.                         "type" => "textarea"),
  610.  
  611.                 array(  "name" => "Spot #5",
  612.                     "desc" => "Paste your <b>400x360</b> ad code above.<br /><br />",
  613.                         "id" => $shortname."_banner5",
  614.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner5.gif\" border=\"0\" /></a>",
  615.                         "type" => "textarea"),
  616.  
  617.                 array(  "name" => "Spot #6 Title",
  618.                     "desc" => "Edit the title text above this ad spot.<br /><br />",
  619.                         "id" => $shortname."_sponsoredby",
  620.                     "std" => "WPSN Recommended Sponsors",
  621.                         "type" => "text"),
  622.  
  623.                 array(  "name" => "Spot #6",
  624.                     "desc" => "Paste your <b>360x360</b> ad code above.<br /><br />",
  625.                         "id" => $shortname."_banner6",
  626.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner6.gif\" border=\"0\" /></a>",
  627.                         "type" => "textarea"),
  628.  
  629.  
  630.  
  631.                 array(  "name" => "Show Spot #7?",
  632.                         "desc" => "Check to activate this banner spot<br /><br />",
  633.                         "id" => $shortname."_show7",
  634.                         "std" => "true",
  635.                         "type" => "checkbox"),
  636.  
  637.                 array(  "name" => "Spot #7",
  638.                     "desc" => "Paste your <b>345x160</b> ad code above.<br /><br />",
  639.                         "id" => $shortname."_banner7",
  640.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner7.gif\" border=\"0\" alt=\"banner 7\" /></a>",
  641.                         "type" => "textarea"),
  642.  
  643.                 array(  "name" => "Show Spot #2?",
  644.                         "desc" => "Check to activate this banner spot<br /><br />",
  645.                         "id" => $shortname."_show2",
  646.                         "std" => "true",
  647.                         "type" => "checkbox"),
  648.  
  649.  
  650.                 array(  "name" => "Spot #2",
  651.                     "desc" => "Paste your <b>345x160</b> ad code above.<br /><br />",
  652.                         "id" => $shortname."_banner2",
  653.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner2.gif\" border=\"0\" alt=\"banner 2\" /></a>",
  654.                         "type" => "textarea"),
  655.  
  656.  
  657.  
  658.                 array(  "name" => "Show Spot #8?",
  659.                         "desc" => "Check to activate this banner spot<br /><br />",
  660.                         "id" => $shortname."_show8",
  661.                         "std" => "true",
  662.                         "type" => "checkbox"),
  663.  
  664.  
  665.  
  666.                 array(  "name" => "Spot #8",
  667.                     "desc" => "Paste your <b>345x160</b> ad code above.<br /><br />",
  668.                         "id" => $shortname."_banner8",
  669.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner8.gif\" border=\"0\" alt=\"banner 8\" /></a>",
  670.                         "type" => "textarea"),
  671.            
  672.  
  673.  
  674.  
  675.                 array(  "name" => "Show Spot #9?",
  676.                         "desc" => "Check to activate this banner spot<br /><br />",
  677.                         "id" => $shortname."_show9",
  678.                         "std" => "true",
  679.                         "type" => "checkbox"),
  680.  
  681.  
  682.  
  683.                 array(  "name" => "Spot #9",
  684.                     "desc" => "Paste your <b>345x160</b> ad code above.<br /><br />",
  685.                         "id" => $shortname."_banner9",
  686.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner9.gif\" border=\"0\" alt=\"banner 9\" /></a>",
  687.                         "type" => "textarea"),
  688.  
  689.  
  690.  
  691.                 array(  "name" => "Show Spot #10?",
  692.                         "desc" => "Check to activate this banner spot<br /><br />",
  693.                         "id" => $shortname."_show10",
  694.                         "std" => "true",
  695.                         "type" => "checkbox"),
  696.  
  697.  
  698.  
  699.                 array(  "name" => "Spot #10",
  700.                     "desc" => "Paste your <b>345x160</b> ad code above.<br /><br />",
  701.                         "id" => $shortname."_banner10",
  702.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner10.gif\" border=\"0\" alt=\"banner 10\" /></a>",
  703.                         "type" => "textarea"),
  704.  
  705.  
  706.  
  707.  
  708.  
  709.                 array(  "name" => "Show Spot #11?",
  710.                         "desc" => "Check to activate this banner spot<br /><br />",
  711.                         "id" => $shortname."_show11",
  712.                         "std" => "true",
  713.                         "type" => "checkbox"),
  714.  
  715.                 array(  "name" => "Spot #11 Title",
  716.                     "desc" => "Edit the title text above this ad spot.<br /><br />",
  717.                         "id" => $shortname."_sptext",
  718.                     "std" => "Sponsored Links",
  719.                         "type" => "text"),
  720.  
  721.  
  722.                 array(  "name" => "Spot #11",
  723.                     "desc" => "Paste your <b>447x380</b> ad code above.<br /><br />",
  724.                         "id" => $shortname."_banner11",
  725.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_banner11.gif\" border=\"0\" alt=\"banner 11\" /></a>",
  726.                         "type" => "textarea"),
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Featured Video Settings</h4></div>",
  741.                         "type" => "heading"),
  742.  
  743.  
  744.                 array(  "name" => "Show Video?",
  745.                         "desc" => "Check to activate the featured video spot on<br />the frontpage.<br /><br />",
  746.                         "id" => $shortname."_showvideo",
  747.                         "std" => "true",
  748.                         "type" => "checkbox"),
  749.  
  750.  
  751.                 array(  "name" => "Embed Code",
  752.                     "desc" => "Paste your chosen video embed code here.<br />(Be sure to resize the video to 345x300)<br /><br /><br />",
  753.                         "id" => $shortname."_featuredvideo",
  754.                     "std" => "<a href=\"#\"><img src=\"http://stylewp.com/assets/defaults/wpsn_featuredvideo.gif\" border=\"0\" /></a>",
  755.                         "type" => "textarea"), 
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.                 array(  "name" => "<div style=\"width:800px;padding:30px;background:#ffeded;\"><h4 style=\"color:#1c1c1c;\">Copyright Settings</h4></div>",
  768.                         "type" => "heading"),
  769.  
  770.  
  771.                 array(  "name" => "Years",
  772.                     "desc" => "Enter the years of copyright<br /><br />",
  773.                         "id" => $shortname."_copyyear",
  774.                     "std" => "1992 - 3009",
  775.                         "type" => "text"),
  776.  
  777.                 array(  "name" => "URL",
  778.                     "desc" => "Enter the full URL to copyright holders site<br /><br />",
  779.                         "id" => $shortname."_copyurl",
  780.                     "std" => "http://www.google.com",
  781.                         "type" => "text"),
  782.  
  783.  
  784.  
  785.                 array(  "name" => "Name",
  786.                     "desc" => "Enter the copyright holders company name<br /><br />",
  787.                         "id" => $shortname."_copyco",
  788.                     "std" => "Your Great Company, LLC",
  789.                         "type" => "text"),
  790.  
  791.  
  792.  
  793.                 array(  "name" => "Rights",
  794.                     "desc" => "Enter the rights reserved text<br /><br />",
  795.                         "id" => $shortname."_copyrights",
  796.                     "std" => "All rights reserved.",
  797.                         "type" => "text"),
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.                                                                                                                        
  810.           );
  811.        
  812. function mytheme_add_admin() {
  813.  
  814.     global $themename, $shortname, $options;
  815.  
  816.     if ( $_GET['page'] == basename(__FILE__) ) {
  817.    
  818.         if ( 'save' == $_REQUEST['action'] ) {
  819.  
  820.                 foreach ($options as $value) {
  821.                     if($value['type'] != 'multicheck'){
  822.                         update_option( $value['id'], $_REQUEST[ $value['id'] ] );
  823.                     }else{
  824.                         foreach($value['options'] as $mc_key => $mc_value){
  825.                             $up_opt = $value['id'].'_'.$mc_key;
  826.                             update_option($up_opt, $_REQUEST[$up_opt] );
  827.                         }
  828.                     }
  829.                 }
  830.  
  831.                 foreach ($options as $value) {
  832.                     if($value['type'] != 'multicheck'){
  833.                         if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); }
  834.                     }else{
  835.                         foreach($value['options'] as $mc_key => $mc_value){
  836.                             $up_opt = $value['id'].'_'.$mc_key;                    
  837.                             if( isset( $_REQUEST[ $up_opt ] ) ) { update_option( $up_opt, $_REQUEST[ $up_opt ]  ); } else { delete_option( $up_opt ); }
  838.                         }
  839.                     }
  840.                 }
  841.                 header("Location: themes.php?page=functions.php&saved=true");
  842.                 die;
  843.  
  844.         } else if( 'reset' == $_REQUEST['action'] ) {
  845.  
  846.             foreach ($options as $value) {
  847.                 if($value['type'] != 'multicheck'){
  848.                     delete_option( $value['id'] );
  849.                 }else{
  850.                     foreach($value['options'] as $mc_key => $mc_value){
  851.                         $del_opt = $value['id'].'_'.$mc_key;
  852.                         delete_option($del_opt);
  853.                     }
  854.                 }
  855.             }
  856.             header("Location: themes.php?page=functions.php&reset=true");
  857.             die;
  858.  
  859.         }
  860.     }
  861.  
  862.     add_theme_page($themename." Options", "$themename Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
  863.  
  864. }
  865.  
  866. function mytheme_admin() {
  867.  
  868.     global $themename, $shortname, $options;
  869.  
  870.     if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
  871.     if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
  872.    
  873. ?>
  874. <div class="wrap">
  875. <h3><?php echo $themename; ?> options</h3>
  876.  
  877. <form method="post">
  878.  
  879. <table class="optiontable">
  880.  
  881. <?php foreach ($options as $value) {
  882.    
  883.     switch ( $value['type'] ) {
  884.         case 'text':
  885.         option_wrapper_header($value);
  886.  
  887.         ?>
  888.                 <input style="width:500px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" />
  889.         <?php
  890.         option_wrapper_footer($value);
  891.         break;
  892.        
  893.         case 'select':
  894.         option_wrapper_header($value);
  895.         ?>
  896.                 <select style="width:350px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
  897.                     <?php foreach ($value['options'] as $option) { ?>
  898.                     <option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
  899.                     <?php } ?>
  900.                 </select>
  901.         <?php
  902.         option_wrapper_footer($value);
  903.         break;
  904.        
  905.         case 'textarea':
  906.  
  907.  
  908.         $ta_options = $value['options'];
  909.         option_wrapper_header($value);
  910.         ?>
  911.                 <textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" style="width:500px;height:100px;"><?php
  912.  
  913.                 if( get_settings($value['id']) != "") {
  914.                         echo stripslashes(get_settings($value['id']));
  915.                     }else{
  916.                         echo $value['std'];
  917.                 }?></textarea>
  918.  
  919.  
  920.         <?php
  921.         option_wrapper_footer($value);
  922.         break;
  923.  
  924.         case "radio":
  925.         option_wrapper_header($value);
  926.        
  927.         foreach ($value['options'] as $key=>$option) {
  928.                 $radio_setting = get_settings($value['id']);
  929.                 if($radio_setting != ''){
  930.                     if ($key == get_settings($value['id']) ) {
  931.                         $checked = "checked=\"checked\"";
  932.                         } else {
  933.                             $checked = "";
  934.                         }
  935.                 }else{
  936.                     if($key == $value['std']){
  937.                         $checked = "checked=\"checked\"";
  938.                     }else{
  939.                         $checked = "";
  940.  
  941.                     }
  942.                 }?>
  943.                 <input type="radio" name="<?php echo $value['id']; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><?php echo $option; ?><br />
  944.         <?php
  945.         }
  946.          
  947.         option_wrapper_footer($value);
  948.         break;
  949.        
  950.         case "checkbox":
  951.         option_wrapper_header($value);
  952.                         if(get_settings($value['id'])){
  953.                             $checked = "checked=\"checked\"";
  954.                         }else{
  955.                             $checked = "";
  956.                         }
  957.                     ?>
  958.                     <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
  959.         <?php
  960.         option_wrapper_footer($value);
  961.         break;
  962.  
  963.         case "multicheck":
  964.         option_wrapper_header($value);
  965.        
  966.         foreach ($value['options'] as $key=>$option) {
  967.                 $pn_key = $value['id'] . '_' . $key;
  968.                 $checkbox_setting = get_settings($pn_key);
  969.                 if($checkbox_setting != ''){
  970.                     if (get_settings($pn_key) ) {
  971.                         $checked = "checked=\"checked\"";
  972.                         } else {
  973.                             $checked = "";
  974.                         }
  975.                 }else{
  976.                     if($key == $value['std']){
  977.                         $checked = "checked=\"checked\"";
  978.                     }else{
  979.                         $checked = "";
  980.                     }
  981.                 }?>
  982.                 <input type="checkbox" name="<?php echo $pn_key; ?>" id="<?php echo $pn_key; ?>" value="true" <?php echo $checked; ?> /><label for="<?php echo $pn_key; ?>"><?php echo $option; ?></label><br />
  983.         <?php
  984.         }
  985.          
  986.         option_wrapper_footer($value);
  987.         break;
  988.        
  989.         case "heading":
  990.         ?>
  991.         <tr valign="top">
  992.  
  993.             <td colspan="3" style="text-align: center;"><h4><?php echo $value['name']; ?></h4></td>
  994.         </tr>
  995.         <?php
  996.         break;
  997.        
  998.         default:
  999.  
  1000.         break;
  1001.     }
  1002. }
  1003. ?>
  1004.  
  1005. </table>
  1006.  
  1007. <p class="submit">
  1008. <input name="save" type="submit" value="Save changes" />    
  1009. <input type="hidden" name="action" value="save" />
  1010. </p>
  1011. </form>
  1012. <form method="post">
  1013. <p class="submit">
  1014. <input name="reset" type="submit" value="Reset" />
  1015. <input type="hidden" name="action" value="reset" />
  1016. </p>
  1017. </form>
  1018.  
  1019. <?php
  1020. }
  1021.  
  1022. function option_wrapper_header($values){
  1023.     ?>
  1024.     <tr valign="top">
  1025.         <th scope="row"><?php echo $values['name']; ?>:</th>
  1026.         <td>
  1027.     <?php
  1028. }
  1029.  
  1030. function option_wrapper_footer($values){
  1031.     ?>
  1032.         </td>
  1033.     </tr>
  1034.     <tr valign="top">
  1035.         <td>&nbsp;</td><td><small><?php echo $values['desc']; ?></small></td>
  1036.     </tr>
  1037.     <?php
  1038. }
  1039.  
  1040. function mytheme_wp_head() {
  1041.     $stylesheet = get_option('revmag_alt_stylesheet');
  1042.     if($stylesheet != ''){
  1043.  
  1044.  }
  1045. }
  1046.  
  1047. add_action('wp_head', 'mytheme_wp_head');
  1048. add_action('admin_menu', 'mytheme_add_admin');
  1049.  
  1050.  function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
  1051.     $content = get_the_content($more_link_text, $stripteaser, $more_file);
  1052.     $content = apply_filters('the_content', $content);
  1053.     $content = str_replace(']]>', ']]&gt;', $content);
  1054.     $content = strip_tags($content);
  1055.  
  1056.    if (strlen($_GET['p']) > 0) {
  1057.       echo "<p>";
  1058.       echo $content;
  1059.       echo "&nbsp;<a href='";
  1060.       the_permalink();
  1061.       echo "'>"."Read More &rarr;</a>";
  1062.       echo "</p>";
  1063.    }
  1064.    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
  1065.         $content = substr($content, 0, $espacio);
  1066.         $content = $content;
  1067.         echo "<p>";
  1068.         echo $content;
  1069.         echo "...";
  1070.         echo "&nbsp;<a href='";
  1071.         the_permalink();
  1072.         echo "'>".$more_link_text."</a>";
  1073.         echo "</p>";
  1074.    }
  1075.    else {
  1076.       echo "<p>";
  1077.       echo $content;
  1078.       echo "&nbsp;<a href='";
  1079.       the_permalink();
  1080.       echo "'>"."Read More &rarr;</a>";
  1081.       echo "</p>";
  1082.    }
  1083. }
  1084. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement