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