|
|

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