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