|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
8 x7 [3 l) @( S// Theme Option: I+ ^) w9 q. O3 K- W
////////////////////////////////////////////////////////////////////////////////* J5 }& k6 V! a! c s$ }1 \0 s
# C. H4 P7 y' k( A6 @2 E$ a4 k$themename = "Zenx";
2 U. I' P" u2 D; {- }/ ]( z$shortname = str_replace(' ', '_', strtolower($themename));+ o" G# O+ D% U! o% f
0 f$ N2 s: i! i' ~& l( N
function get_theme_option($option)
7 z3 p) e: ^% O* H2 J{
: ~0 T$ z6 r# D3 P global $shortname;+ H9 D2 ]1 Y- N* k2 E
return stripslashes(get_option($shortname . '_' . $option));$ r/ n% z; k" W' \
}* S( x% \5 S! u7 H
& C/ q' Q+ }% H, b1 ^+ @1 t, T
function get_theme_settings($option)
9 ~& w& y% T {2 Q5 D{8 {; X8 J' m$ g6 W: v; E
return stripslashes(get_option($option));( }. {5 V4 \3 L$ [3 Y+ l
}. h( n0 M. H. K0 U# q2 D3 ^
$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");
) s! x6 F* L. r8 n$wp_getcat = array();
9 r& g0 k7 q8 D6 h6 T( bforeach ($wp_dropdown_rd_admin as $category_list) {
" I8 q+ l9 E, w9 l: n$wp_getcat[$category_list->term_id] = $category_list->name;! l, |: w) z$ `$ Q9 e1 G% S
}
5 X% v9 D6 R! Q l3 M$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
1 \' Y4 V3 m5 }+ k' ~$ `. Z$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
4 c1 t4 \0 s% M- O. y9 r/ u; Y$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");- o u" Q! N8 m7 e+ K. Z, e& x, ]2 q
0 ]7 W, `$ n* H' P
$options = array (
7 z6 y" ?0 u2 w/ N: ] d Z5 Y B9 k: O# q% V' H
2 r7 m5 S: `2 x8 L ^
array( "name" => "Blog Header Settings",1 D0 i2 X5 k! Z* B: W! d$ V' `
"type" => "heading",
+ F6 M# \& t: O( x9 ?( o/ [ ),8 ]) T( g7 X* i2 t8 ^
3 L2 T. {, u6 ]4 f! R) z3 z( W/ ~
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* i3 T9 ]3 z2 }2 K1 J
"id" => $shortname."_header_logo_activate",
* O& ^% u5 f; i- L, b "type" => "select",
4 N+ O, x1 H& z' i, p. i$ c "std" => "No",. ^! c7 \5 X- b1 n1 f, a- ?
"options" => array("No", "Yes")),
) u% ]# t! j* F! T+ q4 l+ d# f
8 D7 {+ Z) s( X) R0 i2 ] array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",8 q3 _8 i& e: T/ c# E
"id" => $shortname."_logo_url",. B X5 I# Q+ O E" `
"type" => "text",
3 V1 U/ p) ]5 C. T( V "box" => "social",( N. ?- }8 k* h, A( y0 \
"std" => "",
& V) j' g1 P7 N- \: B; f) k2 w ),
* }; `3 ^ H6 y' ]7 [+ e; Z; T 7 d" i8 U( a: v- @$ c) n0 t
array( "name" => "Insert Header Banner HTML Code (Header)
9 n) v* ?* A% a. m* b$ k5 d <br /><em>*Recommended Size 468 x 60</em>( K- F: F/ {. x/ |7 v; A
<br /><em>*leave blank if not use</em>",/ D$ w+ h: q- r% T% b
"id" => $shortname."_header_banner",7 w1 S" N1 h8 c, O
"type" => "textarea",
& v% W- T1 s) L5 F "std" => "",
% D% R; W* d: c/ k+ ?" h ),$ M2 G3 s7 G1 D9 _% q: j' q2 g
# S) c8 F$ f3 w6 e" `) w, h array( "name" => "</div></div>",
9 T+ q2 S/ [! e; D$ b) d "type" => "close",
8 w7 X; Z2 x, | ),
! ?7 c; x" |8 [6 g7 S/ X0 s' f* r8 e4 F9 ^
( M6 |4 e/ y G0 m+ ?% W5 _
array( "name" => "Header Navigation Settings",4 O% n1 j& i! |2 E
"type" => "heading",
( E7 A1 I$ g$ L0 a; G ),; r- V; b7 @$ x, T) v5 K1 r
% S2 W/ h1 Z! l! O* T( ]; y
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
9 m+ Q m) o- x A S$ L. r( I0 L <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />$ w' k4 H: t! _
<em>*Enter the page post ID number only</em><br />
3 O" a: T+ E& g9 s# h4 o <em>*separate by comma</em><br />, H0 y( a2 U9 \, J' [8 X
<em>*Exclude pages which you don't want to show on the header navigation</em>",2 D( C3 S3 R' n( e
"id" => $shortname."_header_page_navigation",
, M3 K+ D" b: l, b$ D1 b "type" => "text",
" y; V# f) o% H5 w+ L+ a "std" => "",
0 r- }" Y: o, H7 C# L ),2 h6 p" D/ o8 Y& b
" B5 C! Z, n4 }: `* H. _
array( "name" => "</div></div>",9 o8 B, W2 s( C4 U: {
"type" => "close",
* p1 X$ L6 U- S8 d- |3 i# {: ~2 ~, C ),$ T6 K) r4 \3 a9 i2 B4 p
& I( W5 d3 ~3 w& W4 @8 Z! U- p* l1 l) J3 ^; a8 O4 Z
array( "name" => "Post Auto Thumbnails Settings",
4 Y# O- e0 Q8 {: r) M: a "type" => "heading",
9 h f) z. a& J' _4 s; p) O ),6 e& P6 t" `* D9 I5 x
! m) n2 ^& _7 Z array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 p: a+ N( F9 d+ B "id" => $shortname."_timthumb_activate",
0 n' Y/ p- P! I! q "type" => "select", m7 A' i5 h/ d8 W4 I, M1 z
"std" => "No", \6 S3 a! t+ E5 ^* }2 {
"options" => array("No", "Yes")),2 }8 P. c" c/ k1 V* v* {
: \8 z7 z# v# W) ^
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
+ [2 s1 Z4 Z: q% n1 T "id" => $shortname."_timthumb_cropping",
8 J$ v3 {3 o4 z" e* A& z& F "type" => "select",, k4 ^1 `5 i; E& i/ }
"std" => "",
6 ]( Z" |% y% ~# E% J" H9 v t: C: r "options" => $crop_position),
% S) s; d5 ? x' D+ z* G8 |; @
" M c& V: a7 x' @ array( "name" => "Insert Width Of Thumbnail Image<br />
J! _0 E% a4 O) _. s <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />9 f( Y4 D+ J3 B* P) h p9 ~
<em>*Leave Blank To Use Default: 250</em><br />",
, M5 s, H d7 P "id" => $shortname."_thumb_width",2 ~0 {4 [5 \( {* [5 B
"type" => "text",1 r9 }+ m1 m9 _7 {0 @$ v
"std" => "",
8 k+ h( j: v( B* c ),: R8 W9 Y+ @; P/ ^
9 g6 C8 @" K; X- v
array( "name" => "Insert Height Of Thumbnail Image<br />
7 G" R6 K" v9 W+ K <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />: _7 e9 }0 Q* I; f: B
<em>*Leave Blank To Use Default: 200</em><br />",
" d" w0 N$ w+ U! y0 J "id" => $shortname."_thumb_height",
9 v/ z& D8 d o: p/ f& E; o "type" => "text",
u$ M3 _- \4 Q3 ] "std" => "",& X. p! ]. A5 E
),
5 M% b7 z' T/ {# E Z$ X9 K" K) D/ v7 H5 H& y# v0 R% G
array( "name" => "</div></div>",
/ l- R p0 B: @% d "type" => "close",6 i( |. L+ w- n- _
),
+ Y( c8 R/ I# O+ x; d$ T/ x2 h1 z- M7 z% L# i J- q
array( "name" => "Featured Content Slider Settings",
U/ [$ a/ W4 K "type" => "heading",- j. S$ D2 y. w9 e$ j& L
),2 |) {3 u3 |8 t4 o& A
$ U$ e1 u2 i2 ]' f) m4 x array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% |4 a9 f( F Y& E; s8 _ "id" => $shortname."_featured_activate",' p% o N c& F: E' O% e
"type" => "select",7 k/ z+ B) F) i! i1 _
"std" => "No",4 D. h+ S& g4 {
"options" => array("No", "Yes")),
# t4 E' b- c' J7 N% t& j3 D/ N, U6 G2 w7 e0 a
/ Q- ?# L6 i! g array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",. l) |' z- L+ ~7 F4 Z( W
"id" => $shortname."_featured_category",: P( q* m% x o+ S! N
"type" => "select",
1 v. c6 g+ E+ q# a# K "std" => "Choose a category:",
% K- B( W% j9 j: _' Q4 k' [: I2 u "options" => $wp_getcat),
. C! q# ]3 | G+ s" v, W8 q* U: }- f7 B' [/ [, r
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
3 L" _" k9 r0 A b "id" => $shortname."_featured_number",
+ b7 W* C# J d$ d "type" => "select",! g6 {0 K6 D$ F1 F7 J$ R! B
"std" => "Number of post:",$ n6 T% @8 o k5 x0 g7 x4 m0 Q
"options" => $number_entries),
: V* h: F& u% H V* K# _& L7 ?6 q$ I6 Z- W1 F
array( "name" => "</div></div>",
" R A% t% B p: f: [ "type" => "close",$ K0 e& ^9 E2 @- V# y+ L
),( l |4 s7 b2 ?' ~. f
/ T& ?& z5 ]' M" ~; d0 A
array( "name" => "Featured Category Settings",! y* u6 `0 [' i3 [8 _9 }
"type" => "heading",) F/ k8 D+ f1 z3 p/ l
),3 _+ G: s8 v+ C5 n/ Y! R3 _
6 |. r n1 L$ G2 V( W
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
9 ?8 f/ @1 E. r "id" => $shortname."_featured_category_activate",# r5 K9 G8 k, b0 c
"type" => "select",( p: @3 t$ O" ~ g* ~
"std" => "No",5 T' T: e1 L3 R4 H6 ^( ]. N
"options" => array("No", "Yes")),
( \/ M$ z. {9 ?/ f7 f' @ . D7 u! G8 t, C3 N
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
, A" l E" v) `1 i% w" t "id" => $shortname."_featured_category_id1",) h! X- u1 |$ o4 g B" N; y7 U
"type" => "select",
8 J6 z4 x" H/ G- ?0 o, y! m9 r' g. \ "std" => "Choose a category:",- c' h1 m4 w& P: h
"options" => $wp_getcat),- j% s3 L- j0 s! a( r4 I7 k
+ G: @' [ ^' H# a$ h1 w
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",! K( j1 ^% P% |6 `$ g' Q; G
"id" => $shortname."_featured_number1",& z) W4 ~% S! n+ M" F. c1 f
"type" => "select",
# F2 g% {' T$ F0 G "std" => "Number of post:",* p- ?/ e, _, w& V5 C6 |/ ]" q
"options" => $number_entries),
) _& H1 M* ^1 h- y+ B
4 k: @! F% q7 `* {6 X; m) S9 d array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
' Q9 o- C7 B: o "id" => $shortname."_featured_category_id2",5 P& G# e! S7 l% x) G) p7 ]8 e1 i
"type" => "select",; n8 H. x( }) a, M5 z2 x0 x
"std" => "Choose a category:",8 Q3 g0 U! M! p$ ]5 j& q
"options" => $wp_getcat),& j+ e2 q* Q9 u6 m: U6 `# g! l
! k: O/ j; l* r8 O) Y9 u
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
$ l) Z! z- n) R+ i( p "id" => $shortname."_featured_number2"," C0 b; d; i2 e
"type" => "select", z3 u; Y- j' D$ D; ~& {2 Q1 b. z9 E
"std" => "Number of post:",
+ \5 X( R& j6 |0 _( c "options" => $number_entries)," L- x0 h+ j7 C1 F7 v
, Q9 e2 K" T) z& P7 \
9 F, d; J/ C6 Q array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",- m4 v0 ?3 g. h% a
"id" => $shortname."_featured_category_id3",
$ I2 K" Q. n4 Y% k7 G( D "type" => "select",* H+ |3 t8 V( }' J# I- h
"std" => "Choose a category:",# K; R* `" x( p0 z
"options" => $wp_getcat),
2 w- |6 \; L9 K' ?* s! T. H- { & G: {5 z: x ^: G1 c
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
* I$ N' R) L6 o2 u# F "id" => $shortname."_featured_number3",
- M2 O; q% {$ k9 P! N) U$ s; ^ "type" => "select",. v- O# V5 y4 A* ~: n! O) u2 q0 Y
"std" => "Number of post:",; v( v0 j/ Z$ r
"options" => $number_entries), {/ n/ W! B+ ~
! y. A$ g" X) h5 S; x3 x9 ?' V \- Q+ N* L4 R4 o
array( "name" => "</div></div>",
3 ^( R7 I0 a/ M6 \: M "type" => "close",
& X$ H1 {7 I g ),) h+ Z+ X. v; J% R" `
! J9 W9 o" e" k) n- ~
9 o( i) j) y3 S; F
array( "name" => "Google Adsense & Analytics Settings",
* o9 L! r6 d) s) ^' ^9 X "type" => "heading",
C% U) \; B+ a& J; n3 {) N ), `& ^9 c: I0 I0 V# l+ P
* d7 L' \$ I6 A& H+ s+ ]9 K
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
- ?1 l4 J2 M+ Y2 @ M' l4 Z: M- M "id" => $shortname."_adsense_loop_activate",0 w5 i! G+ d, E0 f# N# b" X
"type" => "select",
; r/ k2 s* J7 Q x* T8 S' p "std" => "Disable",
; r1 E( \* z: P3 f3 _ "options" => array("Disable", "Enable")), d! Z2 W5 B" ?. z9 ~2 a
8 y& ]! i6 @/ w7 n array( "name" => "Insert Google Adsense Code For Loops Here<br />
* f% G* y- U5 ^: J1 z% M, T <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>"," L4 h. J2 ?: F( U! c. D& Q
"id" => $shortname."_adsense_loop",
+ V, ]. n- V) ]! ?+ u "type" => "textarea",
0 O- L! e/ B3 D+ x5 r* c "std" => "",
9 Z9 c" q9 i/ o; L ),
' Z7 N2 R5 v1 a3 Q P& Y
4 f0 h+ }7 ]- J9 r( A7 f5 H array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
% C: S, R, z$ ?4 q- R" Z! M+ L' l "id" => $shortname."_adsense_single_activate",0 t& R% o2 n+ T, O8 S Z0 {) E5 Z
"type" => "select",' y' u D4 V- x9 h; P& Y% C. S
"std" => "Disable",
+ `; Y/ e. g5 R. r; _( ` "options" => array("Disable", "Enable")),2 J- z- k2 r# |, `
" [: j* X- X3 p n- Q
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
; c, v1 U6 J8 |. ? U$ Z; ? <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",( k" r' l+ y c( K, c( v- K
"id" => $shortname."_adsense_single",
9 @6 P- c) X0 }7 a "type" => "textarea",
' ?* E2 V( h e7 g: } "std" => "",
7 |& I: T0 ~+ g( f2 N ),
0 D- g0 r) S3 N1 I4 M
0 @) w& R, B7 \2 h) g4 v) z+ S* Y9 i4 v5 Z: o: M
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
) B: ]; k( `6 O! ^ K "id" => $shortname."_google_analytics",/ W- B7 N, Q" B" _0 e3 n( e- h
"type" => "textarea",. M. ^. S7 z. T7 W0 a% {3 X$ x
"std" => "",
, v& e0 Y7 C4 I ),
; G% }) d' {$ O8 H: a) a
4 _" {" \( j1 s1 u* l; H& H8 D array( "name" => "</div></div>",
( H) J6 z ^2 M, |9 W* a ? "type" => "close",3 F4 `9 m9 ]1 |6 z N: D( `
),: {) M& o! S/ T- K9 X. q8 ?% I
7 Q* i* W% I$ g9 Y" C
: ~- N: J2 `- j/ K @* y! J array( "name" => "AddThis Social Bookmarking Settings",
/ b, M" _! z; V6 G# ]) N "type" => "heading"," B! Y. r+ l9 V3 @
),* e- M! h, D0 Z2 w
& T1 ]( ~1 b* M: f array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
/ Q' V! B1 M. [% _" J <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
, r5 h2 n' S4 A% `6 O. L "id" => $shortname."_addthis",! o' `2 h; e) D9 r) n. d- K
"type" => "text",' v+ @0 T- f7 H* M/ z5 ]; u# I5 @& [
"box" => "social",8 M5 \' i) I% t8 z1 m
"std" => "",
0 Y6 q! g% }5 e7 a: x8 ^& V ),- c: Y" g j& O$ ]- B* H
* _" w' K; r* D
array( "name" => "</div></div>",
% P, K5 N: R' n$ i9 i2 F* e "type" => "close",8 w$ C: S8 g- a, E6 p2 m5 S
),
# w( |6 V& D% R& h
# n" {! a$ c) Z" s9 W4 v
3 ^+ I3 h, {, X
6 B; D1 w5 c4 {# x6 A0 |- @ array( "name" => "YouTube Video Settings",% ~4 N1 ~7 x5 K3 Q) F/ I% h/ |
"type" => "heading",
/ J2 O( J, Y' [ ),( |- B8 Z% A1 U+ H, d
% M4 V* f/ X) i: ?# j' o4 k/ ^
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) H) \* H4 Q. z& w
"id" => $shortname."_emvideo_activate",1 S3 |, u8 Y8 f; S$ v3 o5 d* k
"type" => "select",6 G* w1 i; f7 @8 a. \+ @+ f
"std" => "No",- K9 F/ _2 f/ I8 f- i
"options" => array("No", "Yes")),- f( V K; Q; l5 S% W% h9 y
/ x2 d$ m {9 e# n0 M 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>",
1 b# w% b1 ~% ^* J& M+ Q "id" => $shortname."_emvideo",
0 B9 M% \9 X2 G! U& f& A a+ P" ?7 N "std" => "",
6 [1 B# u) z, @8 k+ s U+ P3 t+ z "type" => "text"),
& e1 j2 a/ F7 _- i: w
$ B6 d6 G' @7 s# M( w array( "name" => "</div></div>",
! m! {5 u8 _. d9 G. j "type" => "close",! n) x; t. V( K+ z% `5 @5 z
),' y( I' r5 l5 t* h- T) n
: d0 c4 G8 \7 ?3 G array( "name" => "Twitter Settings",
5 i/ e3 T) {2 f "type" => "heading",7 c/ n6 c( E$ S& J+ Y9 I f* Q' v
),! t/ @4 D3 u3 j- A/ X
* y; o* M6 d; T array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 h/ e( J, i0 C' E, p "id" => $shortname."_twitter_activate",' [& w: P: l; m+ p4 J4 a% v3 b
"type" => "select",
! F/ Q$ B) U5 N# P "std" => "No",
9 |3 P" G" a9 G. V8 B "options" => array("No", "Yes")),
7 Y7 L* x# I: }4 L
" G7 X: a; b* c. Z array( "name" => "Insert Your Twitter ID here
4 s' @7 E) [" E" y2 f; B <br /><em>*leave blank if not necessary</em>; p% T4 @4 Z! Z: r2 Q' D
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",4 ?4 r; W8 x" v0 S9 f7 i# V
"id" => $shortname."_twitter",9 t' Z" k9 ^, K- m) S* o. }
"type" => "text",6 m. X# ~( A# N1 a9 @; E& w
"box" => "social",4 d; e" x- S4 }. j
"std" => "",- Z( U! q5 f6 W4 ]+ R( c
),
/ H& V: d0 j& M+ ^" L0 A% `8 Z: o0 I6 `# ?- n
array( "name" => "Enter Twitter Feed Count here
: m3 H+ H! l" ]. A1 L <br /><em>*leave blank if not necessary</em>) V1 ]. C( f) {4 j3 b
<br /><em>*Enter How Many Twitter Feed To Display</em>",) |# o/ Z0 n$ V- n2 Q" K) R- ]- ]5 n
"id" => $shortname."_twitter_count",
- A+ o0 @+ N4 _0 x "type" => "text",7 e. C5 G2 I3 Q& I9 v
"box" => "social",7 t! W( D( S8 T& z r. {* S. n+ q# @
"std" => "",
% J" _! B7 `% Z) `/ p" Y ),
6 r+ b1 g. v+ a; X! z5 J
: H p2 v5 w R2 O3 |5 n* K3 V array( "name" => "</div></div>",
, Q# ?5 p, I$ P* T7 f "type" => "close",
) {- a" s7 ~( G p* K D ),
& a' {: s4 E" X2 k3 B. J# ?) p
1 ]# b. k& x- e2 G/ [9 z: N
! D% ^6 F- A. B4 ? array( "name" => "125 x 125 Banners Advertisement Settings",7 W" f" Y5 R: i$ L
"type" => "heading",
1 D4 t5 g0 E7 u. X2 O ),* H0 [# ^7 Q+ ^& \' k1 y, [
3 W# A ^8 W2 F( k( p$ S/ Q8 o5 d
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
/ }; @( s& `1 t! U, \5 c: E "id" => $shortname."_sponsor_activate",9 Q" o' `7 x: |/ E4 e$ \. }* ^" F
"type" => "select",
9 r- n! i3 N' }8 g9 D "std" => "No",! A! P* g" ` L' f8 `
"options" => array("No", "Yes")),
4 ^; I0 v+ f9 e+ e {5 k
$ w) l- m3 u1 F' F
6 q" k9 B8 ]4 v) n! r* A array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
1 Q" \4 r3 R3 s! J8 s4 y/ J "id" => $shortname."_sponsor_banner_one",/ w' D) a8 r k& U2 d! X/ f
"type" => "textarea",
8 @8 b. G9 U0 M! ]1 W "std" => "",
* c3 v/ H6 d( ] @) H6 X/ B( g* F ),
* p7 w' r* w3 T8 f
! a$ s1 j# z# y0 p ` array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
# K. t# \9 S& ?+ P& |, X3 X! I "id" => $shortname."_sponsor_banner_two",
; m" ]6 N2 ^, a" u* p# L "type" => "textarea",5 f2 K# v6 y& ?3 O: z( S
"std" => "",% U4 F; P- M9 m2 C- [ ~; N
),. h4 A) X% Q6 g& o" Z- X( `
/ ?3 z4 D. l' A8 Z
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
) H$ ]2 W7 m# ]4 ] "id" => $shortname."_sponsor_banner_three",5 P$ ?7 T1 d$ Y8 S
"type" => "textarea",
2 p6 f9 C% I0 i8 Q "std" => "",
, _2 h9 ], g9 Z* K) V ),2 g# s/ N: V. k7 Z
8 x2 m9 J1 b# G2 W
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
9 e1 Z9 W1 L4 ] "id" => $shortname."_sponsor_banner_four", a. l) R' p4 ?( R4 z$ r
"type" => "textarea",% a! _$ ]- Y% Y# v9 s
"std" => "",
$ t% M+ O( X- ?" l) L ),+ r" E0 K) ~# ?$ n9 f0 _
, {: T: a6 n) X6 W9 V
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
; ~0 ~- C7 B7 u% N3 L "id" => $shortname."_sponsor_banner_five",
; _+ o& x' X3 Q/ B "type" => "textarea",
& K5 b1 T7 ^ O( i "std" => "",
5 o5 G* O$ p8 ]0 Q5 T _' d ),
: K+ V' b' ^5 U& {- j7 S. h. R3 R7 y1 i2 ]" e, w
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
0 ^; y( P0 B \, M4 G" f$ a "id" => $shortname."_sponsor_banner_six",
" B u% p4 {% f& S' A7 j "type" => "textarea",$ G' z; w, b& _) n$ Z7 s" `% Z
"std" => "",& ?9 r. a. w# a! G' w; Z
),' F2 {, @! @: `5 h
6 k9 l- n$ v; O* ^3 u; h' o- l
array( "name" => "</div></div>",) ], J8 }* `- v8 U
"type" => "close",, X& F( v+ [' i9 V
),+ q b; D! O$ K, I
# k; j) W- \3 T
8 |3 I |+ g% N& \" e2 z3 r
$ x! n9 P5 d% g);0 |$ @) Q( Y) f$ B' _
; ^6 `' N# Z3 _/ Wfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {" h; K$ i5 p/ L# V& b" \& P
0 p* p3 u0 Q$ n3 u/ Kecho "<div id=\"admin-options\"> ";( O$ P* w/ r8 M0 m( ]
; z8 S( V. d; Kglobal $themename, $shortname, $options;) J c- e, u; z p( W+ n
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
; T F/ z C) j2 E; o0 f" Eif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';/ v/ \" z3 t& Q$ j i7 |
?>
! w0 l; D* V0 t) r1 Y3 S: K! ~/ h9 P1 @+ t
<h4><?php echo "$themename"; ?> Theme Options</h4>
/ A. S+ D8 ^' m8 K( ]6 \! Z& I4 J/ y" J: f
<div class="annouce">
6 M0 \8 k4 Y( R- \% b7 j<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
: p3 s6 y3 c5 E- L<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>( p4 b$ z$ L! Y- j) r
</div>. G% N, E( x( D4 n
3 T4 Y! O' q& [7 W3 q! c) g
<form action="" method="post">
. j) K) n: C. c6 n: z* N
6 ^( Y% r. y0 A m3 t, N! C<?php foreach ($options as $value) { ?>, v1 w! B0 }0 d5 A# G0 s4 H( |
* @" S6 W& Z$ L% r/ [% d+ K/ | H<?php switch ( $value['type'] ) { case 'heading': ?>
. w4 W9 ~; q5 h7 M/ S+ O( E" a1 j6 ]
+ u" `2 y$ @$ [' A<div class="get-option">
& l4 k0 X0 m( O( u. B
! N% I1 N3 L- k/ I! X; F& F2 ~<h2><?php echo $value['name']; ?></h2>
( ]0 G" A- K$ g/ I k+ {: x
. g0 g- F* b: @<div class="option-save">
. W9 N9 m! w/ k) k: j2 Q7 V6 w( h! x$ H5 i. v, \/ E
<?php
( e+ x9 q. d- Gbreak;
8 ~; c1 G8 F0 m( j2 f% s# L" ]case 'text':
0 O6 P% i/ J: r% G, y* i+ ~?>& f& _9 d6 M, ~6 _) S2 D+ ^
' j. Z5 T% ?+ @' }
<div class="description"><?php echo $value['name']; ?></div>
. t0 ] O/ k- ~# b<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (- [6 @8 ?" s! x9 U6 ]( K- S3 n- j
5 m. ?7 }3 y5 T6 W. b$ Uget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>+ ?% t' {. ?+ v, ]: R& ~
- h+ {: y8 u- G<?php
% p( J" d5 ^4 O) v4 ibreak;6 W) Z+ K, M3 k4 w/ `
case 'select':) [% j) } v# Y7 l4 T
?>
, E& ?" J7 d) H% c) b- V! T% ^8 D0 r% {8 h( y& E3 {: ?8 n" _
<div class="description"><?php echo $value['name']; ?></div>
" H' K. e9 R: y" q<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">( g( \" [5 ^9 ?7 R a
<?php foreach ($value['options'] as $option) { ?>6 b8 p3 w; ~# x+ w- r2 d
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
( T$ F% F( s! u* t9 L2 ^<?php } ?>
1 G5 r/ u9 e/ ?) I7 E7 }. [</select>
- K8 r4 J7 K) j" p) ~</p>* U4 H' |9 y( T
+ c7 ^3 |! i2 t' I& W
<?php
2 Z0 T& `* d+ abreak;
1 r* Q9 I6 u; | Qcase 'textarea':
9 M% f. z* `: y$ o! ^$valuex = $value['id'];
) J& M/ W3 C- |8 I, A m% y* _$valuey = stripslashes($valuex);
4 z0 |4 I' M7 ^* N( w% W$video_code = get_settings($valuey);
: p) L2 a& C+ o q0 C3 a4 n$ y?>
) M) V7 @, l7 |6 _1 C" J, B3 C; L0 S0 v7 l
<div class="description"><?php echo $value['name']; ?></div>
/ \6 K8 S! K' M1 [8 k$ p<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }. T% r ]' G, I' j! d
! X! y" G. V& O5 x8 K
else { echo $value['std']; } ?></textarea></p>. T' e2 f) W9 ^* Q5 G$ `0 f7 m
. ~- {8 ~4 }0 I6 G$ x" F+ Q<?php# W( C1 |4 n; w9 N) H6 N
break;+ U, ]) D3 p- d7 B/ u
case 'close':
6 f; E: s/ ^0 y/ m$ K4 ^- |?>
1 r* j5 T; M8 p% d3 n; t) [- h# N. K/ c' I( V' k3 k
<div class="clearfix"></div>' R6 j) @: ?) u$ y0 t+ j
</div><!-- OPTION SAVE END -->
, ]0 G* Q7 Z R2 |1 Z! ]& j* H* V& l: B5 K! e" \4 `. _
<div class="clearfix"></div>
) x% e; T- ^/ a0 U K2 E</div><!-- GET OPTION END -->
; N- I2 D# Z. Y% k) Z4 x% M3 P
<?php
, r# f, p& H( M+ f: ubreak;3 T2 w9 i1 u9 K8 f$ H. N1 n
default;
& L3 `3 V* a; O$ S o* J9 C?>. [# M% H! t+ Z, x1 o; l
( C; I0 |3 ~; O/ b$ N7 y5 \4 E
: g' c- t( `5 w- x/ p ^<?php
" v8 T. i7 X/ s' N! x; ebreak; } ?>8 A1 W: r. d5 Y+ V$ s7 p1 y9 z/ q
; [9 u/ Q9 ^0 X& `' F1 e<?php } ?>
# @, i% n, I. A( M" V5 s# n
# s: S1 M* m- i; s# R) T<p class="save-p">/ D8 a0 D2 l, C+ u, M- _
<input name="save" type="submit" class="sbutton" value="Save Options" />$ |8 L+ D& p, ]* }5 @, N! Z
<input type="hidden" name="action" value="save" />. M4 G$ f5 H# a* ~, k* z
</p>2 i. Z# `( x2 {0 ~- b6 c+ w+ f7 |
</form>
* S6 N* c V6 @+ m6 Z1 z9 L* H6 j- c& c" O/ \; t m
<form method="post">" P8 n2 f# s/ l' U! p3 x; |
<p class="save-p">
; t8 a7 B* I4 u& x2 \4 g* m% p. m<input name="reset" type="submit" class="sbutton" value="Reset Options" />
. \% K9 `- s5 e6 O( L. Y<input type="hidden" name="action" value="reset" />
: s2 \) C0 ` A) d$ F</p>
9 r% A6 m& W& U8 |) }' }8 _</form>
, N: y' u3 R& m0 m$ v0 V' ]" v& M3 x( R
</div><!-- ADMIN OPTIONS END -->( y8 g( Q. a. S, b
# Z$ [: _3 b6 S3 D( I0 f6 F
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
( u. d, {7 I8 W8 i! a. H1 l6 |3 S) j, [0 n2 u) c
function mytheme_admin_register() {
7 ^+ S3 k3 x8 ^" O" K* Qglobal $themename, $shortname, $options;
( P' x2 b& W3 R' F, F) r0 xif ( $_GET['page'] == basename(__FILE__) ) {# |" L1 k: ?0 K
if ( 'save' == $_REQUEST['action'] ) {( D% E) b' K! ^: b; o
foreach ($options as $value) {& J( {2 M+ D' R) H
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }$ v8 A4 K' Z$ e3 U
foreach ($options as $value) {- U0 ^8 x: M6 B& _+ {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
; y3 f% o2 d* `/ b( s0 uheader("Location: themes.php?page=functions.php&saved=true");
5 m( ?( A& H& R& edie;# S9 O. R( r9 t: M, X* P+ E2 q
} else if( 'reset' == $_REQUEST['action'] ) {
# |# \; y- G7 O9 w! }3 a5 Y3 X0 kforeach ($options as $value) {
" {4 E3 x( i$ M+ E. R( Y9 Z; @+ g$ fdelete_option( $value['id'] ); }
8 |* O2 r2 b4 b, F7 \ Iheader("Location: themes.php?page=functions.php&reset=true");% R0 R( k4 c1 c3 x2 c% _" v( k
die;
. p& m5 C1 _# _}" I9 @* ~8 _& j+ W5 b1 l
}
8 Q. ~+ Y+ U0 o" Y" y( D0 |- P' radd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');9 \$ F; S- u, T u
}
0 q7 A5 J( u1 C5 @* n
# ~+ g/ ~+ m5 Cfunction mytheme_admin_head() { ?>
& f; l" h8 w& y. S, _5 w# t% z F<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />+ Q- |4 _" a$ `. \( N
<?php }% M0 S6 }! V* C" U
|
|