|
|

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