Problème syntaxe fichier PHP

Signaler
Messages postés
3
Date d'inscription
jeudi 1 août 2013
Statut
Membre
Dernière intervention
6 août 2013
-
Messages postés
28
Date d'inscription
mardi 25 octobre 2005
Statut
Membre
Dernière intervention
8 octobre 2013
-
Bonjour à tous,

J'ai voulu modifier la page option.php de mon thème wordpress et voila ce qui apparait lorsque je me connecte sur mon site ou mon wp-admin à présent (même après avoir essayer de le remettre comme avant) :

" Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /homez.359/ginkgodrx/www/wp-content/themes/357/functions/options.php on line 335"

Ci dessous le code que j'ai touché :


array(
"name" => "Show Social Tab",
"desc" => "Yes or No to display the popout bar/tab for social icons and links. Defaults to No.",
"id" => $prefix."_use_social_icon_tab",
"type" => "select",
"options" => array("Yes", "No"),
"std" => "No"
),



Si quelqu'un peut m'aider ? mon site ne fonctionne plus du tout :-(

5 réponses

Messages postés
3
Date d'inscription
jeudi 1 août 2013
Statut
Membre
Dernière intervention
6 août 2013
1
Bonjour à vous et merci pour la réponse, ci dessous l'intégralité de mon code si cela peut aider :

<?php

$options = array (
 
array( "name" => $themename." Options",
	"type" => "title"),


array( "name" => "Color Scheme &amp; Logo",
	"type" => "section"),
array( "type" => "open"),
 
array( "name" => "Color Scheme",
	"desc" => "Select whether you want to use the black or white version of the theme.",
	"id" => $prefix."_color_scheme",
	"type" => "select",
	"options" => array("black", "white"),
	"std" => $initial_color_scheme),
	
array( "name" => "Replace Logo",
	"desc" => "* Requires a .png file, $options_logo_requirements.<br/><br/>This will replace your logo image with a new one you upload. This replaces the file on upload, it will take effect whether you save or not.",
	"id" => $prefix."_logoreplace",
	"type" => "upload",
	"btntxt" => "Replace Logo Image",
	"dragtxt" => "Drop File Here to Change Logo",
	"script" => "functions/uploaders/replace_logo.php",
	"preview" => "true",
	"previewtxt" => "Current Logo:",
	"previewimg" => THEME_ROOT."/images/logo.png"."?rand=".rand(1000,9999)),

array( "name" => "Replace Login Logo",
	"desc" => "* Requires a .png file, 326x100.<br/><br/>This will replace logo on the login screen with a new one you upload. This replaces the file on upload, it will take effect whether you save or not.",
	"id" => $prefix."_loginlogoreplace",
	"type" => "upload",
	"btntxt" => "Replace Login Logo Image",
	"dragtxt" => "Drop File Here to Change Login Logo",
	"script" => "functions/uploaders/replace_login_logo.php",
	"preview" => "true",
	"previewtxt" => "Current Logo:",
	"previewimg" => THEME_ROOT."/images/login-logo.png"."?rand=".rand(1000,9999)),


array( "type" => "close"),
array( "name" => "Blog Options",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Blog Home Paging",
	"desc" => "The number of posts to display per page for the blog home page type.<br/><br/>Note: zero means there is no defined amount and all will show on one page.",
	"id" => $prefix."_blog_home_posts_per_page",
	"type" => "select",
	"options" => array("0", "3", "4", "5", "6", "7", "8", "9", "10", "12", "15", "20", "25", "30", "40", "50"),
	"std" => "6"),

array( "name" => "Replace Blog Default Background",
	"desc" => "* Requires a .jpg file<br/><br/>This will replace the default BG that shows for each blog post (no need to use the background shortcode on blog posts). It will work best with an image at least 1280x900. This replaces the file on upload, it will take effect whether you save or not.",
	"id" => $prefix."_blogbgreplace",
	"type" => "upload",
	"btntxt" => "Replace Blog BG",
	"dragtxt" => "Drop File Here to Change Blog BG",
	"script" => "functions/uploaders/replace_blog_default_bg.php",
	"preview" => "true",
	"previewtxt" => "Current Background:",
	"previewimg" => THEME_ROOT."/images/blog-default-bg.jpg"."?rand=".rand(1000,9999)),

array( "name" => "Replace Custom Default Avatar",
	"desc" => "* Requires a .png file 40x40.<br/><br/>This is where you can upload your own custom default avatar for comments. For it to take effect you must choose 'Custom Default' as the theme's Default Avatar in the 'Settings -> Discussion' page. This replaces the file on upload, it will take effect whether you save or not.",
	"id" => $prefix."_blogavtrreplace",
	"type" => "upload",
	"btntxt" => "Replace Avatar",
	"dragtxt" => "Drop File Here to Change Blog BG",
	"script" => "functions/uploaders/replace_custom_default_avatar.php",
	"preview" => "true",
	"previewtxt" => "Current Custom Avatar:",
	"previewimg" => THEME_ROOT."/images/custom_grav.png"."?rand=".rand(1000,9999)),


array( "name" => "Show Top Date Bar",
	"desc" => "Yes or No to display the bar at the top of posts that says their date of publish and how many comments are on them.",
	"id" => $prefix."_blog_use_topbar",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

array( "name" => "Show Tags",
	"desc" => "Yes or No to display the post tags at the bottom of posts.",
	"id" => $prefix."_blog_use_tags",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

array( "name" => "Show Social Icons",
	"desc" => "Yes or No to display the social sharing icons at the bottom of posts.",
	"id" => $prefix."_blog_use_social",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

array( "name" => "Show Related Posts",
	"desc" => "Yes or No to display up to 5 posts that are related to the first tag of this post. Displays at the bottom of post.",
	"id" => $prefix."_blog_use_related",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "No"),

array( "name" => "Show Featured Image in Post",
	"desc" => "Yes or No to automatically show a post's featured image (if there is one) at the top of the post.",
	"id" => $prefix."_blog_fimg_post",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

array( "name" => "Show Comments",
	"desc" => "Yes is normal. No will totally disable all post comments and won't even show a 'comments closed' or anything, will just act as if comment system doesn't exist.",
	"id" => $prefix."_blog_use_comments",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

array( "name" => "Read More Button",
	"desc" => "This determines the text in the 'Read More' button that shows to link to articles. Also affects the same button in search results and archives.",
	"id" => $prefix."_blog_readmore",
	"std" => "Read More",
	"type" => "text"),

array( "name" => "Archives Title Text",
	"desc" => "This determines the title of most archive pages.",
	"id" => $prefix."_archive_title",
	"std" => "Archives",
	"type" => "text"),

array( "name" => "Archives Sub-Title Text",
	"desc" => "This determines the small text under the title of most archive pages. Use %s to indicate where the date metric would go.",
	"id" => $prefix."_archive_sub_title",
	"std" => "Archives for %s:",
	"type" => "text"),

array( "name" => "Tag Archives Title Text",
	"desc" => "This determines the title of tag archive pages.",
	"id" => $prefix."_tag_archive_title",
	"std" => "Tags",
	"type" => "text"),

array( "name" => "Tag Archives Sub-Title Text",
	"desc" => "This determines the small text under the title of tag archive pages. Use %s to indicate where the tag name would go.",
	"id" => $prefix."_tag_archive_sub_title",
	"std" => "Posts tagged '%s'",
	"type" => "text"),

array( "name" => "Category Archives Title Text",
	"desc" => "This determines the title of category archive pages.",
	"id" => $prefix."_category_archive_title",
	"std" => "Categories",
	"type" => "text"),

array( "name" => "Category Sub-Title Text",
	"desc" => "This determines the small text under the title of category archive pages. Use %s to indicate where the category name would go.",
	"id" => $prefix."_category_archive_sub_title",
	"std" => "All posts from the '%s' category",
	"type" => "text"),


array( "type" => "close"),
array( "name" => "Pages Options",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Automatic H1",
	"desc" => "Yes means that wordpress will automatically add the page's header1 title based on the page title (it already does this for blog posts and other pages, but you can turn it off for custom pages). If No then you can use shortcodes to add the header1 yourself in a custom manner.",
	"id" => $prefix."_auto_h1",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

array( "name" => "Automatic Background",
	"desc" => "Yes means that wordpress will use the background you specified for the blog default for pages as well (with the exception of Home Page pages). If No (the default) then you can use shortcodes to give each page custom backgrounds.",
	"id" => $prefix."_auto_bg",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "No"),

	
array( "type" => "close"),
array( "name" => "Contact Form",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Form Mailing Address",
	"desc" => "Set the email address that the contact form will send mail to.",
	"id" => $prefix."_contact_email",
	"std" => "your@emailaddress.com",
	"type" => "text"),
					
array( "name" => "Form Mail Subject Line",
	"desc" => "This determines the subject of the email message when a use uses your contact form.",
	"id" => $prefix."_contact_subject",
	"std" => "[Form Contact From Your Website]",
	"type" => "text"),

array( "name" => "Mail Success Text",
	"desc" => "This determines the text shown upon successful contact form sending.",
	"id" => $prefix."_contact_success",
	"std" => "Success! Your message has been sent, thank you!",
	"type" => "text"),

array( "name" => "Mail Fail Text",
	"desc" => "This determines the text shown upon failed contact form sending. (shouldn't ever really happen, but for thoroughness make a message anyway)",
	"id" => $prefix."_contact_fail",
	"std" => "Sorry, there was an error. The message didn't send.",
	"type" => "text"),

array( "name" => "Invalid Name Message",
	"desc" => "The message that shows if no name is given in the contact form.",
	"id" => $prefix."_invalid_name",
	"std" => "Please give your name.",
	"type" => "text"),

array( "name" => "Invalid Email Message",
	"desc" => "The message that shows if an invalid email is given in the contact form.",
	"id" => $prefix."_invalid_email",
	"std" => "Please use a valid email address",
	"type" => "text"),

array( "name" => "Invalid Phone Message",
	"desc" => "The message that shows if no phone number is given in the contact form.",
	"id" => $prefix."_invalid_phone",
	"std" => "Please give your phone number.",
	"type" => "text"),

array( "name" => "Invalid Message Message",
	"desc" => "The message that shows if no message is given in the contact form.",
	"id" => $prefix."_invalid_message",
	"std" => "Please write a message.",
	"type" => "text"),

array( "name" => "Sending Message",
	"desc" => "The message that shows while the form is attempting to send.",
	"id" => $prefix."_sending_message",
	"std" => "Sending Message...",
	"type" => "text"),


array( "type" => "close"),
array( "name" => "404 Page",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Header Text",
	"desc" => "The header text to show on the 404 error page.",
	"id" => $prefix."_404_header",
	"std" => "Page Not Found",
	"type" => "text"),

array( "name" => "Sub-Header Text",
	"desc" => "The small text under the header on the 404 error page.",
	"id" => $prefix."_404_subheader",
	"std" => "Page Not Found",
	"type" => "text"),

array( "name" => "Body Text",
	"desc" => "The body text to show on the 404 error page.",
	"id" => $prefix."_404_text",
	"std" => "This page doesn't exist. It may have been removed or the link you followed may have an error. Try using the links on your right or the menu on your left to find what you're looking for.",
	"type" => "textarea"),

array( "name" => "Show Sidebar",
	"desc" => "Yes means that the widget sidebar will show on the 404 error page.",
	"id" => $prefix."_404_show_sidebar",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),


array( "type" => "close"),
array( "name" => "Comments Options",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "No Comments Text",
	"desc" => "Text to show above comments when there aren't any yet.",
	"id" => $prefix."_comments_none",
	"std" => "No Comments Yet",
	"type" => "text"),

array( "name" => "Single Comment Text",
	"desc" => "Text to show above comments when there is 1 comment.",
	"id" => $prefix."_comments_one",
	"std" => "One Commment",
	"type" => "text"),

array( "name" => "Multiple Comment Text",
	"desc" => "Text to show above comments when there are multiple comments. (use % to indicate where the number will show)",
	"id" => $prefix."_comments_mult",
	"std" => "% Comments",
	"type" => "text"),

array( "name" => "Comments Closed Text",
	"desc" => "Text to show above comments when comments are closed.",
	"id" => $prefix."_comments_closed",
	"std" => "Comments are closed.",
	"type" => "text"),

array( "name" => "Leave Comment Text",
	"desc" => "Text to show above the form for adding a comment.",
	"id" => $prefix."_comments_leave",
	"std" => "Leave a Comment",
	"type" => "text"),

array( "name" => "Leave Comment Text",
	"desc" => "Text to show above the form when replying to a comment.",
	"id" => $prefix."_comments_reply",
	"std" => "Reply to This Comment",
	"type" => "text"),

array( "name" => "Leave Comment Text",
	"desc" => "Text in the comment form submit button.",
	"id" => $prefix."_comments_submit",
	"std" => "Post Comment",
	"type" => "text"),

array( "name" => "Commment Note",
	"desc" => "Small text that displays below the message area of the comment form giving instructions about what to write. Leave blank for no note.",
	"id" => $prefix."_comments_note",
	"std" => "",
	"type" => "textarea"),
	

array( "type" => "close"),
array( "name" => "Social Tab Options",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Show Social Tab",
	"desc" => "Yes or No to display the popout bar/tab for social icons and links. Defaults to No.",
	"id" => $prefix."_use_social_icon_tab",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "No"),

array( "name" => "Facebook",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_facebook",
	"std" => "",
	"type" => "text"),

array( "name" => "Twitter",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_twitter",
	"std" => "",
	"type" => "text"),

array( "name" => "Google Plus",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_gplus",
	"std" => "",
	"type" => "text"),

array( "name" => "LinkedIn",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_linkedin",
	"std" => "",
	"type" => "text"),

array( "name" => "Pinterest",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_pinterest",
	"std" => "",
	"type" => "text"),

array( "name" => "Digg",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_digg",
	"std" => "",
	"type" => "text"),

array( "name" => "Delicious",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_delicious",
	"std" => "",
	"type" => "text"),

array( "name" => "Reddit",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_reddit",
	"std" => "",
	"type" => "text"),

array( "name" => "StumbleUpon",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_stumbleupon",
	"std" => "",
	"type" => "text"),

array( "name" => "YouTube",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_youtube",
	"std" => "",
	"type" => "text"),

array( "name" => "Vimeo",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_vimeo",
	"std" => "",
	"type" => "text"),

array( "name" => "MySpace",
	"desc" => "Link to your profile/account the corresponding website/network. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_myspace",
	"std" => "",
	"type" => "text"),

array( "name" => "RSS",
	"desc" => "Link to an RSS feed. To not show this icon, leave this blank.",
	"id" => $prefix."_social_icon_tab_rss",
	"std" => "",
	"type" => "text"),
	

array( "type" => "close"),
array( "name" => "Search Page",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Header Text",
	"desc" => "The header text to show on the search page.",
	"id" => $prefix."_search_header",
	"std" => "Search Results",
	"type" => "text"),

array( "name" => "Search Results Text",
	"desc" => "The small text that indicates something like 'results for such and such search'. Use %s wherever you want the search terms to appear in the text.",
	"id" => $prefix."_search_results",
	"std" => "Search Results For: %s",
	"type" => "text"),

array( "name" => "No Results Text",
	"desc" => "The text to show when there's no results.",
	"id" => $prefix."_search_nores",
	"std" => "Sorry, no results. Please try again.",
	"type" => "text"),


array( "type" => "close"),
array( "name" => "Typography",
	"type" => "section"),
array( "type" => "open"),

array( "name" => "Google Font 1",
	"desc" => "The first of 3 fonts you can import from the google font api.",
	"id" => $prefix."_googlefont_1",
	"std" => $google_font_1,
	"type" => "text"),

array( "name" => "Google Font 2",
	"desc" => "The second of 3 fonts you can import from the google font api.",
	"id" => $prefix."_googlefont_2",
	"std" => $google_font_2,
	"type" => "text"),

array( "name" => "Google Font 3",
	"desc" => "The third of 3 fonts you can import from the google font api.",
	"id" => $prefix."_googlefont_3",
	"std" => $google_font_3,
	"type" => "text"),

array( "name" => "H1-H4 Font Stack",
	"desc" => "This is the font stack to be use for h1-h4 headers. (Note: also gets used for the calendar widgets caption text and paging buttons)",
	"id" => $prefix."_fontstack_h1h4",
	"std" => $h1_h4_fontstack,
	"type" => "text"),

array( "name" => "H5-H6 Font Stack",
	"desc" => "This is the font stack to be use for h5 &amp; h6 headers.",
	"id" => $prefix."_fontstack_h5h6",
	"std" => $h5_h6_fontstack,
	"type" => "text"),

array( "name" => "Top Level Nav Font Stack",
	"desc" => "This is the font stack to be use for nav menu top level text.",
	"id" => $prefix."_fontstack_menu1",
	"std" => $top_nav_fontstack,
	"type" => "text"),

array( "name" => "Second Level Nav Font Stack",
	"desc" => "This is the font stack to be use for nav menu second level text.",
	"id" => $prefix."_fontstack_menu2",
	"std" => $sub_nav_fontstack,
	"type" => "text"),

array( "name" => "Button Font Stack",
	"desc" => "This is the font stack to be use for the shortcode type buttons.",
	"id" => $prefix."_fontstack_buttons",
	"std" => $button_fontstack,
	"type" => "text"),

array( "name" => "Body Text Font Stack",
	"desc" => "This is the font stack to be use for normal text in the template.",
	"id" => $prefix."_fontstack_normal",
	"std" => $body_fontstack,
	"type" => "text"),

array( "name" => "Import Symbols",
	"desc" => "The symbols used via the [symbol] shortcode requre importing some extra files (which must be on every page). If you do not use the symbols and do not want to import them, then set this to 'No'.",
	"id" => $prefix."_import_symbols",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),
	

array( "type" => "close"),
array( "name" => "Advanced Options",
	"type" => "section"),
array( "type" => "open"),
	
array( "name" => "Google Analytics Code",
	"desc" => "Paste your Google Analytics code here (including the script tags).",
	"id" => $prefix."_analytics_code",
	"type" => "textarea",
	"std" => ""),

array( "name" => "MailChimp API Key",
	"desc" => "Obtained from your MailChimp account. Only needed if using the mailchimp_subscribe shortcode to build mailing lists.",
	"id" => $prefix."_mailchimp_api_key",
	"std" => "",
	"type" => "text"),

array( "name" => "Replace Favicon",
	"desc" => "* Requires a .png file, 16x16.<br/><br/>This will replace your favicon image with a new one you upload. This replaces the file on upload, it will take effect whether you save or not.",
	"id" => $prefix."_favicon",
	"type" => "upload",
	"btntxt" => "Replace Favicon",
	"dragtxt" => "Drop File Here to Change Favicon",
	"script" => "functions/uploaders/replace_favicon.php",
	"preview" => "true",
	"previewtxt" => "Current Favicon:",
	"previewimg" => THEME_ROOT."/favicon.png"."?rand=".rand(1000,9999)),

array( "name" => "Custom CSS",
	"desc" => "Add any custom CSS here and it can add new styles or override existing ones (do not include the style tags).",
	"id" => $prefix."_custom_css",
	"type" => "textarea",
	"std" => ""),

array( "name" => "Custom Shortcodes",
	"desc" => "Add custom shortcodes here with no PHP knowledge. See documentation for details.",
	"id" => "mb_custom_shortcodes",
	"type" => "textarea",
	"std" => ""),

array( "name" => "Check for Theme Updates",
	"desc" => "Yes or No to monthly checks for theme updates. Recommended Yes because WordPress is always changing, and new theme versions are constantly needed to keep up. WordPress themes are not a 'install and forget it' thing, it's important to keep up with newer versions.",
	"id" => $prefix."_check_theme_version",
	"type" => "select",
	"options" => array("Yes", "No"),
	"std" => "Yes"),

 
array( "type" => "close")
 
);



//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------


function mytheme_add_admin() {
 
global $themename, $prefix, $options;
 
if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) {
 
	if ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) {
 
		foreach ($options as $value) {
			if( isset($value['id']) )
				if ( isset($_REQUEST[$value['id']]) )
					update_option( $value['id'], $_REQUEST[ $value['id'] ] );
		}
 
	foreach ($options as $value) {
		if ( isset($value['id']) )
			if( isset($_REQUEST[$value['id']]) )
				{ update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); }
	}
	 
		header("Location: admin.php?page=options.php&saved=true");
	die;
	 
	} 
	else if( isset($_REQUEST['action']) && 'reset' == $_REQUEST['action'] ) {
	 
		foreach ($options as $value)
		{
			if ( isset($value['id']) )
				delete_option( $value['id'] );
		}
	 
		header("Location: admin.php?page=options.php&reset=true");
	die;
	 
	}

	// added by MBMedia so that on reset or on original the options go to their standard values, not blank
	foreach ($options as $value) {
		if ( isset($value['id']) && isset($value['std']) )
			add_option( $value['id'], $value['std'] );
	}

}

add_menu_page($themename.' Settings', $themename.' Settings', 'administrator', basename(__FILE__), 'mytheme_admin');
}


function mytheme_add_init() {

$file_dir = get_template_directory_uri();
wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");
wp_enqueue_script("rm_script", $file_dir."/functions/rm_script.js", false, "1.0");
wp_enqueue_style("qq_css", $file_dir."/functions/fileuploader.css", false, "1.0", "all");
wp_enqueue_script("qq_script", $file_dir."/functions/fileuploader.js", false, "1.0");
}
function mytheme_admin() {
 
global $themename, $prefix, $options;
$i=0;
 
if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
if ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
 
?>
<div class="wrap rm_wrap">
<h2><?php echo $themename; ?> Settings</h2>
 
<div class="rm_opts">
<form method="post">
<?php foreach ($options as $value) {
switch ( $value['type'] ) {
 
case "open":
?>
 
<?php break;
 
case "close":
?>
 
</div>
</div>
<div style="height:16px;"></div>

 
<?php break;
 
case "title":
?>
<p>To easily customize your theme, use the menus below.</p>

 
<?php break;
 
case 'text':
?>

<div class="rm_input rm_text">
	<label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
 	<input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id'])  ); } else { echo $value['std']; } ?>" />
 <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
 
 </div>
<?php
break;
 
case 'textarea':
?>

<div class="rm_input rm_textarea">
	<label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
 	<textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?></textarea>
 <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
 
 </div>
  
<?php
break;
 
case 'select':
?>

<div class="rm_input rm_select">
	<label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
	
<select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
<?php foreach ($value['options'] as $option) { ?>
		<option <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?>
</select>

	<small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
</div>
<?php
break;
 
case "checkbox":
?>

<div class="rm_input rm_checkbox">
	<label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
	
<?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>
<input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />


	<small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
 </div>
<?php break;
// the upload portion of this script was added by MBMedia and is NOT open source
case 'upload':
?>

<div class="rm_input rm_text">
	<label><?php echo $value['name']; ?></label>
	<div style="float:left;">
		<div id="<?php echo $value['id']; ?>">		
			<noscript>			
				<p>Please enable JavaScript to use the file uploader.</p>
			</noscript> 
		</div>
		<?php if ($value['preview'] == 'true') {
		echo '<div>';
		echo '<p style="font-size:11px;color:#999;">'.$value['previewtxt'].'</p>';
		echo '<img src="' . $value['previewimg'] . '" id="' . $value['id'] . '_preview" style="padding:5px; border:1px dashed #BBB; width:auto; height:auto; max-width:260px;" />';
		echo '</div>';
		} ?>
	</div>
	<small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
	<script>
		jQuery(document).ready(function() {            
			var uploader = new qq.FileUploader({
				element: document.getElementById('<?php echo $value['id']; ?>'),
				action: '<?php echo THEME_ROOT.'/'.$value['script']; ?>',
				multiple: false,
				template: '<div class="qq-uploader">' + 
                '<div class="qq-upload-drop-area"><span><?php echo $value['dragtxt']; ?></span></div>' +
                '<div class="qq-upload-button"><?php echo $value['btntxt']; ?></div>' +
                '<ul class="qq-upload-list"></ul>' + 
             '</div>',
				onComplete: function(){ var obj = jQuery('#<?php echo $value['id'].'_preview'; ?>'); if (obj) obj.attr('src', '<?php echo $value['previewimg']; ?>?'+(new Date().getTime())); },
				debug: true
			});           
		});
	</script> 
</div>
<?php break;
case "section":

$i++;

?>

<div class="rm_section">
<div class="rm_title"><h3><img src="<?php echo get_template_directory_uri(); ?>/functions/images/trans.gif" class="inactive" alt=""><?php echo $value['name']; ?></h3><span class="submit"><input name="save<?php echo $i; ?>" type="submit" value="Save changes" />
</span><div class="clearfix"></div></div>
<div class="rm_options">

 
<?php break;
 
}
}
?>
 
<input type="hidden" name="action" value="save" />
</form>
<form method="post">
<p class="submit">
<input name="reset" type="submit" value="Reset" />
<input type="hidden" name="action" value="reset" />
</p>
</form>
</div> 
 

<?php
}
?>
<?php
add_action('admin_init', 'mytheme_add_init');
add_action('admin_menu', 'mytheme_add_admin');

?>
Messages postés
33492
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
22 septembre 2021
351
" Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /homez.359/ginkgodrx/www/wp-content/themes/357/functions/options.php on line 335"

Dans le code que tu nous a colle..la ligne 335 du message d'erreur correspond a laquelle ?
Messages postés
33492
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
22 septembre 2021
351
Bonjour,

Deja ca aurait été bien d'utiliser les balises de code dans votre message.

Ensuite, qu'avez vous aux lignes précédentes ? Parfois les erreurs de syntaxe indiqués à une ligne proviennent des lignes d'avant.
Messages postés
28
Date d'inscription
mardi 25 octobre 2005
Statut
Membre
Dernière intervention
8 octobre 2013
2
Bonjour,

la seule chose que je vois est la virgule à la fin de ton array au lieu d'un point-virgule, mais comme on ne sait pas ce qu'il y a avant ou après, impossible de savoir si c'est une erreur...

Un peu plus d'info / code pourrait nous donner plus d'indices
Messages postés
28
Date d'inscription
mardi 25 octobre 2005
Statut
Membre
Dernière intervention
8 octobre 2013
2
pas d'erreur dans le code, mais à tous les coups c'est une variable qui à un problème.
fait des echos dessus si tu peux.
Messages postés
3
Date d'inscription
jeudi 1 août 2013
Statut
Membre
Dernière intervention
6 août 2013
1
Je ne m'y connais pas du tout, faire des echos veut dire ? :-)
Messages postés
33492
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
22 septembre 2021
351
Echo en php permet d'afficher du texte ou le contenu de variables.
Perso vu que tu as des tableaux préfère "print_r ()".
Messages postés
28
Date d'inscription
mardi 25 octobre 2005
Statut
Membre
Dernière intervention
8 octobre 2013
2
Exactement, mais en l'occurence je parlais des variables dans les tableaux. Car les tableaux en eux-mêmes n'ont pas d'erreurs.
Donc echo, print_r() ou var_dump(), c'est toi qui voit.