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