|
|

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