|
|

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