|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
: C# b; E6 h' q7 x; [// Theme Option" B {+ I5 z+ _7 d& w
////////////////////////////////////////////////////////////////////////////////* ], R2 O: h1 [# Y: R
& e6 o+ R+ Y7 w- R0 u# W, }* Z" i$themename = "Zenx";3 ~ u3 J \/ N. |
$shortname = str_replace(' ', '_', strtolower($themename));/ [3 n3 u o7 v$ e% B
G) Q$ L" Y& y
function get_theme_option($option)
* L" `3 N. N$ d$ V+ f: g{, l6 Z+ f. i' i! L9 M' z
global $shortname;5 ]5 r( b7 ?( a4 E4 ?3 d# R
return stripslashes(get_option($shortname . '_' . $option));) t% Q% @4 |$ ?
}* O6 @5 }6 v. q9 V* _
% h. z# \# B9 `; A* \0 g8 B2 t
function get_theme_settings($option)
0 s5 i9 u* s6 J5 ~! Z- c{9 x5 s) s4 B4 A, _' ~! r9 m
return stripslashes(get_option($option));/ H' W9 ^" R6 }& Z+ \- [% O
}
9 w: H3 s7 P8 f% }$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC"); ~/ |9 _ m' i; S
$wp_getcat = array();
! J- p/ {5 u! D5 L! t/ C( ~foreach ($wp_dropdown_rd_admin as $category_list) {
3 p/ y. A. l& h/ T$wp_getcat[$category_list->term_id] = $category_list->name;- o9 G8 s. |9 D7 n" q: u! m8 S3 [
}
9 O+ r5 N1 M2 d. ]/ o* K* R$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
& T, {, A! E! P# h$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
/ ~; _+ h# h3 s+ {; g$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");4 O% i* b0 r. M! @6 T- [8 B$ U' M
$ w. w- t" r) z6 h' Y
$options = array (
0 W( ~% I) P, Z5 k. u
' I6 j9 ~! I7 j O3 l$ f1 }& o# m5 h+ b
/ ~% I; F n: B+ d! t8 s6 p8 X array( "name" => "Blog Header Settings",
4 u- t; |. {0 C9 k8 z "type" => "heading",
1 ]3 X1 d5 j: {% F4 B' m ),
1 s* q8 X( M' M/ s/ d- k9 f
' p! r, A3 Y4 n1 m4 s3 ] array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 I( D) E" H& s$ V3 r3 } "id" => $shortname."_header_logo_activate"," X3 q' |5 V( k9 S
"type" => "select",3 R+ i+ `+ R6 ?/ v* [9 {
"std" => "No",
V2 R- l/ Q0 |$ {# S$ Z "options" => array("No", "Yes")), G0 V6 K! ]! ]: z- t# A
5 f Q' p3 U- O) U' b( [
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",( T5 C( y" _$ [% t1 y; a
"id" => $shortname."_logo_url",
, R; ]( w0 l$ C" w' G, B4 S "type" => "text",
7 n0 Q$ f9 ]) [3 k9 q5 N- D, c( C "box" => "social",/ a6 p; [1 k' Y+ K) a* ~
"std" => "",
% m- G$ S5 ` r. P; j ),
6 }7 a3 n! s# U( |0 a3 G7 C
0 X2 D4 `- g8 M; r2 ~( l% r array( "name" => "Insert Header Banner HTML Code (Header)
. C6 E: \+ K2 g& V <br /><em>*Recommended Size 468 x 60</em>
' ^) ?0 D3 Q1 Z3 Z4 ?: S: S <br /><em>*leave blank if not use</em>",
& G0 s3 B& N# f9 h# i( { "id" => $shortname."_header_banner",
( H; z3 U8 g0 T; l2 g! e "type" => "textarea",
) y; h# V# T8 ?) y "std" => "",$ L1 |/ y# E7 W9 ]0 I
),
9 z- c/ \8 b' E
" M; h9 f2 O6 ?- f; d% f array( "name" => "</div></div>",
$ g) X; H4 A4 a% L; s "type" => "close",
, G" O3 J* n8 e9 X% B# O ),1 }( G# b# ], H, }' q) |
- R7 X9 p/ n4 j2 n8 |& [1 v/ A; b0 J$ E$ l" P; |1 } A* R5 i
array( "name" => "Header Navigation Settings",0 g+ ^0 i' W9 o/ X1 N( U
"type" => "heading",
) J5 i8 p" X0 K% U0 B! j% M. Q' a" g ),! q W; l7 [( O) L% U7 k
$ K. Y4 j r& m' l
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />6 |" a8 l2 ]1 j$ U/ M$ F9 U8 I" T! a
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />$ D5 C. P/ O3 d4 m& f# }2 u
<em>*Enter the page post ID number only</em><br />
# S' g6 ^# `% [, S: F$ D* F <em>*separate by comma</em><br />
4 }1 e8 x/ Z, U5 S8 ]. x% l <em>*Exclude pages which you don't want to show on the header navigation</em>",
. i7 X* B% ~( X @. F9 Q "id" => $shortname."_header_page_navigation",
" F$ S7 O* T/ O% _$ X7 {+ Y "type" => "text",) `3 t2 \! C1 J) B) [' o! O
"std" => "",
. L c3 j2 T/ C+ u0 o ),! [; b! x9 ?3 R4 o; r5 e) X
2 f; S4 H, v. S array( "name" => "</div></div>",
( F+ F8 }6 A( u. |; ^# k "type" => "close",2 J5 W+ G2 Z" w( A# N4 G- n
),
. h3 L+ O+ [- }6 l8 ~" N ! f k* D5 P* e% C& H
% F4 P$ E- _: B- v& h& ~& k M
array( "name" => "Post Auto Thumbnails Settings",. \7 U0 N2 y, m" O2 v0 l6 W
"type" => "heading",: W ^3 u: G# e' e
),+ B* F3 Z# U! M: `; R
/ a a$ w* p& L5 p ^0 T7 k- w array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
+ f' k: z. r- f: c4 N "id" => $shortname."_timthumb_activate",
: E# ~* V. w8 J( W3 O "type" => "select",
: o T( u: Y* `% S3 f' t& B "std" => "No",( C; H* Y$ [2 R6 T {6 F
"options" => array("No", "Yes")),
. b- e1 a$ d0 `9 [7 z
! t( C, |. y" t array( "name" => "If Timthumb is enabled, Please choose its cropping method",
& e3 J7 Q2 k% ]& @( ?* D7 l8 E0 b. N( @ "id" => $shortname."_timthumb_cropping",$ `0 v7 ?* z( U% S1 g/ e6 ]' B
"type" => "select",
4 m+ J) J/ t- j% s2 q "std" => "",% B/ \% x0 `" d
"options" => $crop_position),
) R9 b/ \. c5 M$ D( ^6 F9 z
9 H- y1 H; Z" G1 f array( "name" => "Insert Width Of Thumbnail Image<br />
) { g6 n* ~+ R: F( k <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />% W) e' ^, Z4 j- k+ e
<em>*Leave Blank To Use Default: 250</em><br />",
( v9 e. ~ j0 F- y, S+ ]# |; ^ "id" => $shortname."_thumb_width",+ w0 [& Z- j2 ~: z( X; _
"type" => "text",0 A& j/ b3 |$ O" c' e
"std" => "",
" Q% g! z% M0 @ ),1 l5 d: c }, N1 _) @/ n
I* _/ U8 j* W' |) Y2 c: B, D
array( "name" => "Insert Height Of Thumbnail Image<br />( o" C8 A3 L1 i; e
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
( n \/ k( f: W& p* ?$ A/ o <em>*Leave Blank To Use Default: 200</em><br />",) T6 i- W. l+ L a$ W1 y; @; [6 V
"id" => $shortname."_thumb_height",
) t% I1 }6 S( X "type" => "text",, \4 z$ b" a4 u! H- t
"std" => "",
% V! j8 o1 E; ^, V3 z @ ),
- b' M0 }# c \; _* }
' J0 H A% A, d8 d. e& p array( "name" => "</div></div>",. `3 |2 z9 {4 I7 {0 }
"type" => "close",
5 c( E) Z, p& a- W' O( C$ o. L0 { ),8 X% }, H1 `. O! y
" j7 _3 K; ^8 b. W& R8 R1 Q' y, I
array( "name" => "Featured Content Slider Settings",
) a/ n# V/ f& C! s3 N "type" => "heading",5 b' ~7 Z- a) y7 E" o$ |& }6 E
),
$ K3 x$ m J: O
$ l' c( l$ S# u2 O- j; ^ array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ e, ?6 v) B) Q# ]
"id" => $shortname."_featured_activate",
) D& @ y! ?% u% y- W, n "type" => "select",
# \- h' z3 }) y) D "std" => "No",1 t- a3 n9 \. |3 T1 r6 D+ i
"options" => array("No", "Yes")),
1 }! u. x7 L# Q" }0 c/ f8 Z. j8 e' |* A3 }% { s+ n* ?
* C3 r+ p, B( h/ I3 _3 a2 t( |
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
) @% V9 b/ F% X, C6 d2 a "id" => $shortname."_featured_category",
) n. g- j7 _. s6 l "type" => "select",
# ^+ R% P) f5 {! s, a: M) ^ "std" => "Choose a category:"," Y+ ]4 K% S2 }( `) Q
"options" => $wp_getcat),. g6 k. |' q& M$ S
. o9 e0 F2 W+ R
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
* T% B6 r* h9 t: n$ @$ g7 {* A! _ "id" => $shortname."_featured_number",
9 P# Z% `, C, {- @: r* o1 R- U2 j3 X "type" => "select",
9 R6 g/ Z/ R7 ^ p* a "std" => "Number of post:",
5 F; T+ X. g$ [% i8 M5 a. U: W "options" => $number_entries),' q/ A4 x; N4 M, a* F: @- H
, I+ q6 n. ^- t2 C. ] array( "name" => "</div></div>",1 w: M6 e0 }" ^8 b+ ?5 l* K
"type" => "close",
( y9 b0 X+ v7 m1 _, g( X5 v ),
@/ B2 M& \; X. S* W6 Z+ Y $ H/ I9 b* |! Q+ o; b6 s5 \$ Z
array( "name" => "Featured Category Settings",8 ? I4 G# M0 V3 Y( M! y6 V6 x
"type" => "heading",
3 a: H0 R: Z9 U; m6 } ),
$ v0 v. ~# O9 r1 Q& J& J2 R
$ ^/ F5 s$ z! i8 t. X array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! b# v: I$ C: w7 X9 N; v
"id" => $shortname."_featured_category_activate",
! H# U) v+ g; N4 w& x6 ? "type" => "select",
5 ]/ [% X* I# G "std" => "No",0 M# }8 {5 c* S4 v3 T
"options" => array("No", "Yes")),7 e! F0 I9 k/ L# ~8 Z8 |: `, m
4 D) v* O; U* ]0 y/ H8 k array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>", z* M+ y0 V5 u! P3 u. q$ i, D+ I
"id" => $shortname."_featured_category_id1",
9 s) y$ {. q5 g G/ m; C4 y. ^ "type" => "select",
1 S' M" `( v6 Y. [ "std" => "Choose a category:",, T9 N6 \1 _: ~ b# [+ g* W
"options" => $wp_getcat),4 P8 z0 D( C p
, Z, J( H( Z6 n5 E7 ?, C2 `
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",1 M# |& P! f1 h# }
"id" => $shortname."_featured_number1",
5 A% k% D _+ g "type" => "select",# [: L* y# G" X
"std" => "Number of post:",
( P$ \! p! t- _ "options" => $number_entries),
' Q6 M6 Q( k8 R
" K) J% ?1 ^1 [# b9 \( m" b3 _ array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
5 a! Z2 x9 q. r) F; H# k' A "id" => $shortname."_featured_category_id2",
3 l, J) ~3 h9 C4 }% V/ M$ X3 s "type" => "select",
" `/ Z; _, }: j: t% h+ p "std" => "Choose a category:",
9 L$ T0 z( X4 w/ t$ `$ s "options" => $wp_getcat),
! j; _/ ^! {( G, }1 i- t: j
$ @! W& M) a4 E, d5 U/ p J0 d array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",0 O9 e; L, h2 \1 t( T9 P& F# M
"id" => $shortname."_featured_number2",
* A5 R0 a5 M+ C1 T "type" => "select",
6 ?0 R% Q6 |' ]/ h "std" => "Number of post:",
" ^5 }1 d$ J9 W1 D; ]3 t8 S "options" => $number_entries),5 k" L- b/ @2 {! T# L
& x! ?( L% V# S
; ]$ t, N" l" X) H% L9 ^$ m
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
% u$ T9 I: W. T5 t% _ P "id" => $shortname."_featured_category_id3",
# U- a! c& |9 a" ]- Z: S "type" => "select",
7 @' ^6 a. y% L% w) }& l "std" => "Choose a category:",
9 J; \1 ]8 w2 i9 f" _. L "options" => $wp_getcat),
) Q3 N( F4 l K% F( [3 L+ }
+ ?5 `2 T% B8 G! z! k/ X6 z array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",- A8 `7 l) d; m j5 A; B
"id" => $shortname."_featured_number3",
. D' n4 Y6 v- K" v "type" => "select",
& G [6 f2 ]# ]+ l* A- C3 t( G _ "std" => "Number of post:",
; r/ B, r6 }3 J "options" => $number_entries),8 E$ s; P! {7 b. \1 ^( I* ]- ]2 p+ S6 x
8 \8 s% Q$ M1 f* U" i( M5 \
W6 C% o; {& w6 B0 M7 J Z
array( "name" => "</div></div>",
: @0 j8 a; Z- ?2 M9 e% I$ f8 N1 _4 F "type" => "close",8 @ Q4 y7 G: C5 z, S& R9 V
),
6 S* k$ M9 @) n. _* }
! P( ~' T" N* s5 S6 G$ i
, I; M6 Q+ d8 R% E0 `3 X array( "name" => "Google Adsense & Analytics Settings",* Z# O7 G' K) X! t9 r# ]
"type" => "heading",
, U3 e( M- P! X3 i v; M2 _( t ),
4 T8 e* G M' z n$ h+ c1 o3 p$ A
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",) L1 A: G) W, _: C4 L: @
"id" => $shortname."_adsense_loop_activate",+ Q1 S; N- x5 ^; K, q( i0 P
"type" => "select",
5 m4 h3 v# \4 U* k "std" => "Disable",
5 \" R- e9 z* p "options" => array("Disable", "Enable")),$ y$ ]. J/ E& H" J4 d
( I4 x. H. _) r+ k$ d& e" A array( "name" => "Insert Google Adsense Code For Loops Here<br />% M3 |# R* B; _- [1 ]; c
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; W* f+ P! X7 N1 X+ O
"id" => $shortname."_adsense_loop",
& Q# q6 r+ ]% ]8 ~* ]1 _! B% H "type" => "textarea",
9 | N# T. e, s "std" => "",7 ?! ?" R( q( ]+ Z2 e) A6 q
),0 K. Z4 R$ U; y
0 q% M) n1 F# t# G! F
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
9 ] `. @6 L" q+ h8 w! V "id" => $shortname."_adsense_single_activate",
Q" t9 v. Q0 h$ z( R+ P- c "type" => "select",3 f# I9 q; C1 [
"std" => "Disable",
; f4 C' A% {# f5 H$ ?7 l1 z6 B "options" => array("Disable", "Enable")),' \ m6 {& a8 ~
" T: B$ I7 I# n$ P9 ^( L
array( "name" => "Insert Google Adsense Code For Single Page Here<br />: m6 m4 y4 G4 o: g$ G
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, {! L, N0 P# [
"id" => $shortname."_adsense_single",
# z& \5 m4 _# Y( @ "type" => "textarea",( G- m7 N; f6 G( z2 {1 C( z
"std" => "",
4 q' S, g) a/ p5 L% Q7 r2 K2 p/ N ),
' f; k' `4 i) h: \% e; k7 f2 |' Y) Z, O) w# k2 K9 H; e. H
( m8 U8 d+ c6 [
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
! W9 q. g! f! w$ X "id" => $shortname."_google_analytics",; V# U- F Z; E. l. V, {: w# E
"type" => "textarea",4 G) A& f9 n' @
"std" => "",
" q# h3 Q4 P5 j0 x; k) t$ [2 F X ),
* o3 C R; [3 k5 z5 W7 U3 n3 M2 F
array( "name" => "</div></div>",2 H+ k/ j3 y: W' ]; o$ ?; I* M
"type" => "close",% K7 _) N9 G: \ f( ^+ m0 o7 x
),+ f" ]# E8 x& t5 v/ F
5 Y1 G1 ?4 T0 k7 ^
. o, u* _7 Q7 Z+ H; J% n% G
array( "name" => "AddThis Social Bookmarking Settings",7 M" R2 B1 C. Y* X3 {3 U
"type" => "heading",
, g& |/ [& Q) o1 }5 J ),& {& {2 ? _; O2 N N6 k8 b$ x: `
4 ?9 k2 {: X$ \3 B
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
^5 c" E( `4 I* ~ G+ e4 G' j4 B <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",% K6 m; [! ~: r/ s) g2 q. ~
"id" => $shortname."_addthis",* Z4 W# @$ z/ W' H7 x. n
"type" => "text",0 b% ^4 Q* O4 @, X
"box" => "social",' t' Y4 T4 e8 {3 v6 A" x
"std" => "",
- r$ Y7 c8 u3 a8 B& k) O ),8 X0 @' @% o+ y
, k, {" b# h' X y( k l
array( "name" => "</div></div>",
! _6 X# {) k! [. B "type" => "close",+ `# G3 C k7 k$ b7 e& }1 }0 R
),$ g N* B+ w9 A+ n
$ E+ I" m" W9 {7 {* L6 g) @6 w
4 d/ Q4 u4 K- a Z! [* x1 P : J- A' T' Z6 _: v% b9 V+ c) }% u8 O
array( "name" => "YouTube Video Settings",
, O: y ?$ l" w4 H "type" => "heading",4 ~ C8 F8 x' h" ?
),8 c. V3 Q9 R k# \- n8 q1 b
0 t( ^8 g% x, Z7 s array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ j- ^' o; [( |
"id" => $shortname."_emvideo_activate",* Q! Q. K% K2 @7 m6 k
"type" => "select", x: K* }+ A) X
"std" => "No",
# Z; N f1 |/ j/ o5 P+ o7 g "options" => array("No", "Yes")),
) v2 o+ }5 G: s, b9 g; a- F$ e8 ~& V/ c
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",8 u ]3 u' J3 M: k- _: }2 Q
"id" => $shortname."_emvideo",, f. K8 l& ?# p
"std" => "",
6 \& z5 a) O# w. @; x* O$ v, y "type" => "text"),
3 U$ A+ Y4 g; T3 {% [" B G$ j# L+ Q2 K4 ?" |% |7 @1 P3 D
array( "name" => "</div></div>",
5 |& v6 _( t& R "type" => "close",# `4 x, S0 Q6 |( `' `
),; U6 l% n4 P( d2 J
7 d$ @8 n" Y7 p
array( "name" => "Twitter Settings",
) v8 g8 A0 K1 a/ w6 ? "type" => "heading"," ~7 J4 z/ i& Y7 V1 P
),. x; p6 V8 t/ m c/ n; S& h
' o" s' |6 K# }" w7 D, ]8 c& ]
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 a' B& ?3 G2 y- X7 }
"id" => $shortname."_twitter_activate",0 }$ x: i# v$ c1 a" t7 h& o- o' v& g2 |
"type" => "select"," p! q; L( v) Z7 @ A* r: `
"std" => "No",
3 C! `- P3 n2 E) h "options" => array("No", "Yes")),
+ y9 S9 m- `" \* g3 f" m# c) f3 x7 c* W0 R6 v
array( "name" => "Insert Your Twitter ID here: B0 N6 u4 Y$ z
<br /><em>*leave blank if not necessary</em>% u" F* B& x* B1 h4 l4 ]
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
' {0 Z, r. [0 y0 m) o "id" => $shortname."_twitter",
4 g- E: r$ w& i "type" => "text",; t! ]8 U* n* e) c+ @
"box" => "social",/ ?. O0 @: x0 W7 R
"std" => "",+ Q8 @4 |6 {) W; g, U
),2 X1 R R1 i$ \5 `8 `7 [
3 x! F, c& u( _. B0 T l" q
array( "name" => "Enter Twitter Feed Count here' k5 p4 ?+ y, i- K; Y
<br /><em>*leave blank if not necessary</em>7 Z# s2 S4 v3 D, ?: R- }: Y, N: {
<br /><em>*Enter How Many Twitter Feed To Display</em>",
+ U5 X! {5 c* h# N. Q2 } "id" => $shortname."_twitter_count",) v! d. m" U, W
"type" => "text",( R# L6 X+ [$ r% L4 w2 j+ H
"box" => "social",) i3 I* ]2 q* N+ ^# p% N: Q2 _6 T
"std" => ""," q2 J" T5 c& K! O5 h% q8 y2 L3 O
),/ O! C4 |* n( z6 ]( ^
7 W& }# d' o8 \; o" r7 q i array( "name" => "</div></div>",
1 K/ n. J& ~' Q+ \& ?* s E "type" => "close",
: _% G h+ D/ M# k$ B1 B ),
$ U, X0 O7 n7 d9 z( F0 w ! k6 E& }+ D% Z; J1 G
6 Q0 J/ q! f1 z! ] array( "name" => "125 x 125 Banners Advertisement Settings",
8 `6 J7 }3 o. F# R* P7 f# q "type" => "heading"," C/ s& t9 N1 i' {
),
. l" a( T& a: |; N / X0 ~3 p. I) c; z
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 ~, `7 e( s) u. | "id" => $shortname."_sponsor_activate",
2 e% O. X$ {9 X' u! M+ j( o! Z "type" => "select",
/ M; h8 n0 G4 W. w& H7 s "std" => "No",
4 M8 e( @8 r, K" G5 q: K$ [ "options" => array("No", "Yes")),
. K* U# {3 i) i$ o' e1 A
& w& t: z" s$ O W8 g$ r1 b
8 M: x1 ?5 q7 e+ d8 U6 d; v* n: w array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
F( n7 i+ X7 Z6 R! |1 a "id" => $shortname."_sponsor_banner_one",; j7 t; p, K$ R4 Z; |# B- g
"type" => "textarea",
; {) F/ r9 \" m% T "std" => "",
& j Q8 \( C! a* n4 @: a2 H ), / v" U# M- d# C6 `
& K1 U: q# f: N' N' h9 A- ] array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
# C9 Q0 ~4 D M "id" => $shortname."_sponsor_banner_two",1 d9 o6 i" t7 t* d1 H* M) u
"type" => "textarea",
; j5 H: T* d. P* h "std" => "",
, {5 R6 m6 C( n# K: Q9 q ),
0 ]4 {5 R# U _+ J& D1 [
6 s) t* l* j: X$ [1 a$ y array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
! x* Z, r* O% Q. S7 K! K- } "id" => $shortname."_sponsor_banner_three",
2 d( E1 N: V7 J, O# R "type" => "textarea",
4 V- s* Z3 q% ~6 | "std" => "", q9 U! {# g8 O/ X
),
' I, d$ a8 F" C4 \. K, b
9 j( V3 q' |$ Y9 L) n* O7 x array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",$ F9 \" M: a3 Z+ n) e% f1 h j3 s
"id" => $shortname."_sponsor_banner_four",4 r8 l% Y$ S2 Y3 r1 s% X, C
"type" => "textarea",
0 s9 V# n% Q+ k "std" => "",
0 |% T% u3 U A3 h l+ M ),
+ _1 b* r9 c* a: P7 m
5 i8 K* M/ x. E, I1 f$ [* x array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",5 G: e) B3 o; n f9 F% L
"id" => $shortname."_sponsor_banner_five",; ?7 N3 s. Y" w7 H1 O7 u1 h
"type" => "textarea",
! z/ z4 g4 m+ S0 _" O "std" => "",
( ~ q& g) i1 Q- q ),1 F W* u1 n( b& N
+ t+ ]. W2 F- v* ]
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",7 D6 i/ i9 @* }
"id" => $shortname."_sponsor_banner_six",3 I) D* {8 e" S7 B- ]
"type" => "textarea",+ f' }/ X5 E; e7 @. }- P( X) m1 `
"std" => "",; J- I7 t( n7 B/ d& u
), b" i& [1 o- W8 k3 ~6 \
+ W$ _, X8 n! ^* s, @$ c array( "name" => "</div></div>",
# `1 {6 M0 @7 p: B# N "type" => "close",
% N+ G4 h2 W- Q6 E ),
, B( z9 V: B# g0 D9 [! F1 _
* C' I; H+ _ n7 g, e( L) `6 ]$ w
& k# d8 t. \7 T* Y2 V* ~" J9 i. T" T$ p5 a' O
);, g* c7 m% u% }# w; u
. U8 e( G. `, L/ d1 }function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {4 |6 K3 U9 s/ A" }9 Y! O7 P
* V0 b5 i9 I# _# F5 G5 N7 |% uecho "<div id=\"admin-options\"> ";# ~' [4 A1 Z1 f& q3 |! N
# S2 c& \1 ~# o( l. P/ a
global $themename, $shortname, $options;" W9 [4 |$ I4 z0 x+ D' D
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';* R' g. c7 J. M
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
5 v( `' y% t6 @) N. N6 }5 v?>2 k3 ?8 R5 `( `+ b4 t
- E1 n6 D( d4 {% E<h4><?php echo "$themename"; ?> Theme Options</h4>
& @' H l& {/ v0 _8 t8 `! J# Y
8 ^/ v8 ~+ k7 |7 B* f8 i<div class="annouce">
0 m% U+ \, }7 F3 {1 Q: {" I<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>, ^% [& p# P2 G+ s# q3 ]$ b) O
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
5 {' v( j: y# {/ m</div>" U/ w: @9 n/ ` b
( t2 y9 f& @4 A& w
<form action="" method="post">
% j! ^% Q% c- r: B0 o8 g4 `, z6 t2 G3 i: s @9 d0 _3 [* {
<?php foreach ($options as $value) { ?>
3 X9 a1 c4 o( j8 Y0 ?! W5 m
( `. a9 L+ Q& d3 M3 o: X<?php switch ( $value['type'] ) { case 'heading': ?>) ~0 r' ^. {) ?* ?$ {) i
: |# P8 s( V' \# [<div class="get-option">4 O! v* N1 ~1 U2 A9 z
& z9 N( M j: @8 D3 F<h2><?php echo $value['name']; ?></h2>3 t& w- O0 U8 g
9 O) H5 C! t* b T% L6 R: \. j<div class="option-save">
J2 E l# b$ i+ }8 Y6 y
' {+ D( Z- J8 Z; d: `7 T, g G! q<?php+ F( S- ~5 L3 U d2 ~3 L
break;" I- S# E# u1 b. g
case 'text':
: q1 S0 F- X0 k?>- s+ I m& \ Z5 k$ y. z9 V
' d1 Y4 o: N+ o/ l7 h! q% J% y* c<div class="description"><?php echo $value['name']; ?></div>" i% B* ^/ G* M ~$ \# e% [# G
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (( M) O _6 q1 g+ x
/ Y6 l' G5 G" L8 Y6 g# p* @get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
/ H7 F8 ~% B/ z& \" ?
) o: H1 ^; m$ J. ^<?php! b9 T. u* X9 f+ T; R
break;( E& w e( S/ a; M+ L7 H U$ F
case 'select':
& U/ T5 G0 Y( }9 r5 h?>
6 G, B& h0 C1 O0 ~* ?$ ^. N3 W
2 k( P5 ?0 z' _1 s3 `<div class="description"><?php echo $value['name']; ?></div>/ @8 I( Q2 n8 Y6 `( V
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">1 j' n6 C9 h4 p8 u
<?php foreach ($value['options'] as $option) { ?>
% R, f, P& S4 @8 g: b' Z+ Z<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option> S6 F8 r5 _/ y( H8 H6 Q7 O& H
<?php } ?>
, \7 S! `/ c# d( d</select>; b. ?2 L# ?9 b4 S: a% h8 y
</p>( p d3 A8 x/ L B8 G
3 y) R" F: T* j' b+ |4 E* i. t+ \<?php
6 l/ W& L7 J2 M D: e$ ]* hbreak;- f/ q1 y, @$ A
case 'textarea':: L( a9 W6 n: G( c
$valuex = $value['id'];
9 q: X/ s+ P. [& R+ P0 f/ K$valuey = stripslashes($valuex);
2 u) c! |0 B4 o$ w) X$video_code = get_settings($valuey);& p( |& e- W0 K5 N
?>
$ x) ?5 ]8 o) d- N" L
1 G; U1 ]+ J9 n; X1 Z; X7 R, z<div class="description"><?php echo $value['name']; ?></div>1 i* x0 _! Y6 l- H& O4 e9 j
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }' }, L) k6 r- y) f: P
' ~; `6 ^/ L+ B+ `8 H+ p) j3 F
else { echo $value['std']; } ?></textarea></p>* W* ^; \) ]# b- U% E% O- R
1 v( R5 ?- R/ x0 A<?php7 T1 _& x" n3 t& G& `
break;+ ^! _2 S' [" l! J9 g2 R+ x
case 'close':
8 ]3 p2 R. q% I?>2 l3 ]% x0 C4 M/ `. Z6 X
2 D C( a/ G8 h: T+ x3 Q: j<div class="clearfix"></div>4 j+ u- ^* u8 \+ t& l+ u$ U- b
</div><!-- OPTION SAVE END -->
1 i0 |6 `/ |5 ^; d& a* _
- i% K" D3 Z" ~# i: w+ r<div class="clearfix"></div>. d9 M8 G$ y9 H9 P6 x) i( w
</div><!-- GET OPTION END -->
7 E0 A2 ^/ I# e! o! q1 G
# l2 s1 s5 A1 \4 s+ J7 q+ U5 R<?php2 @5 k+ C _4 p! N2 o- D
break;0 }/ B4 d0 ~# B5 |
default;7 p. n6 c1 k8 d4 \* _* c
?>5 e; a) O) x+ l, f1 w
$ h( j' N6 X$ h7 y4 c
5 z) c: ~ L+ [3 a4 C1 F& F. k @/ ^<?php' G& G9 e! R$ B: ?
break; } ?>% S' k/ w5 ^8 P
* B4 @( {- l7 f8 O( u* z
<?php } ?>
# y0 S0 C: ?$ b4 C& k% t: K0 e
8 ~( t( Y( V1 C% D: W<p class="save-p">9 H( I9 w, R. y# T& v0 _1 I/ D
<input name="save" type="submit" class="sbutton" value="Save Options" />' u+ e5 f5 `; M/ h# P
<input type="hidden" name="action" value="save" />' P; {3 X' h- K1 s
</p>7 W2 a* ]4 `/ J4 ^' Y
</form>( s5 F ~, v M7 H s; z
+ m; U! K3 R4 `! f
<form method="post">
6 t4 D" d/ O, Q; c$ C<p class="save-p">
( G. P) j/ ^" K) F<input name="reset" type="submit" class="sbutton" value="Reset Options" />! Y0 z7 e( G# b) j5 W* i
<input type="hidden" name="action" value="reset" />
# g7 R" c& I9 z( @7 k4 g</p>* ]1 m1 T# N) l
</form>" h- j# x( `+ H5 Y6 z5 j
1 f* o- ~: H$ z/ K3 P</div><!-- ADMIN OPTIONS END -->& t# n# m% F5 Y# C5 M$ ]& G
8 ?! O9 v2 K% k5 ~; N<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }- i4 U$ ~. c E2 x% O2 o+ [
]- f2 O( G5 M6 p7 Z2 n0 h: b
function mytheme_admin_register() {
+ s- Y3 |# x% d' X2 kglobal $themename, $shortname, $options;( e1 H a6 \' e0 U; l
if ( $_GET['page'] == basename(__FILE__) ) {9 s% d, R2 y; J5 N
if ( 'save' == $_REQUEST['action'] ) {, }# H$ ?* d! e) f
foreach ($options as $value) {
5 w+ z: B1 y/ a* ~5 O3 Tupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
0 n, C3 O1 l3 |: bforeach ($options as $value) {- \' O; d" z8 [
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } r4 [7 H; p; A' L& T
header("Location: themes.php?page=functions.php&saved=true");
9 A- n2 N" ?& _, a/ k- Bdie;& E3 N g9 R! D0 M0 [$ R, g; e# F
} else if( 'reset' == $_REQUEST['action'] ) {2 z( V1 m9 @1 m! y
foreach ($options as $value) {) `" Y1 X0 `- Y) y: C1 O
delete_option( $value['id'] ); }
/ I- N% |5 f" ?4 U6 q6 Zheader("Location: themes.php?page=functions.php&reset=true");- F# G. _1 r5 Z1 h2 Y
die;5 @7 e, _1 b% _+ G& X3 A
}* i# K$ J6 |/ o9 H* F7 W
}
* ^ U# w: p! U# T% d6 [, Xadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');1 L+ g( Q, W! l* {; J1 q* s
}: O0 H4 S' x. `' W; N- }
# H: x# s1 i6 C, d& ufunction mytheme_admin_head() { ?>3 c8 s- O) q& K# |6 e
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />4 A P) j. i7 l k
<?php }% ]$ F# N5 B' @9 H* J
|
|