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