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