|
|

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