|
|

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