|
|

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