|
|

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