|
|

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