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