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