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