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