|
|

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