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