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