|
|

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