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