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