|
|

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