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