|
|

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