|
|

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