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