|
|

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