|
|

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