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