|
|

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