|
|

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