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