|
|

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