|
|

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