|
|

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