|
|

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