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