|
|

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