|

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