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