|
|

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