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