|
|

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