|
|

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