|
|

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