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