|
|

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