|
|

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