|
|

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