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