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