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